Not_Wilson Posted October 19, 2016 Share Posted October 19, 2016 So I'm trying to make a book for a mod and I want the reader to say two things if they aren't tagged as a specific term. local function onread(inst, reader) if reader:HasTag("bookworm") then reader.components.talker:Say(GetString(reader, "ANNOUNCE_BOOKREAD")) else reader.components.talker:Say(GetString(reader, "ANNOUNCE_LOWRESEARCH")) reader.components.sanity:DoDelta(-20) inst:DoTaskInTime(10, reader.components.talker:Say(GetString(reader, "ANNOUNCE_LOWSANITY"))) end return true end However, it hops right to the ANNOUNCE_LOWSANITY string. Any ideas? Link to comment https://forums.kleientertainment.com/forums/topic/70969-really-quick-dotaskintime-question/ Share on other sites More sharing options...
CarlZalph Posted October 19, 2016 Share Posted October 19, 2016 I believe it should be wrapped in a function. inst:DoTaskInTime(10, function() reader.components.talker:Say(GetString(reader, "ANNOUNCE_LOWSANITY")) end) Link to comment https://forums.kleientertainment.com/forums/topic/70969-really-quick-dotaskintime-question/#findComment-826911 Share on other sites More sharing options...
Not_Wilson Posted October 19, 2016 Author Share Posted October 19, 2016 That worked. Thank you! Link to comment https://forums.kleientertainment.com/forums/topic/70969-really-quick-dotaskintime-question/#findComment-827180 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now