Hi, I wanted to make a script that relayed a chat message every two minutes. So far I got
Guard:
Code:
local guard = 18790
function guardshout(Unit, Event)
Unit:RegisterEvent("Yell", 30800, 0)
end
function Yell(Unit, Event)
local chance == math.random(1,3)
if(chance == 1) then
Unit:Emote(27, 0)
Unit:SendChatMessage(12, 0, "Quiet you!")
end
if(chance == 2)then
Unit:Emote(15, 0)
Unit:SendChatMessage(14, 0, "I don't care!")
end
if(chance == 1)then
Unit:Emote(29, 0)
Unit:SendChatMessage(14, 0, "You sure about that?")
end
end
RegisterUnitEvent(guard, 18, "guardshout")
Terrorized citizen - Has been nulled until I could figure it out.:
Code:
local harrassed = 18792
local guard = 18790
function guyshout(Unit, Event)
Unit:RegisterEvent("Shout", 30000, 0)
end
function Shout(Unit, Event)
local chance == math.random(1,3)
if(chance == 1)then
Unit:Emote(20, 0)
Unit:SendChatMessage(14, 0, "Please... you don't have to do this!")
end
if(chance == 2)then
Unit:Emote(20, 0)
Unit:SendChatMessage(14, 0, "I don't want to dance!")
end
if(chance == 3)then
Unit:Emote(20, 0)
Unit:SendChatMessage(14, 0, "I have kids!")
end
end
RegisterUnitEvent(harrassed, 18, "guyshout")
--Guards turn!
local guard = 18790
function guardshout(Unit, Event)
Unit:RegisterEvent("Yell", 6800, 0)
end
function Yell(Unit, Event)
if(chance == 1) then
Unit:Emote(27, 0)
Unit:SendChatMessage(12, 0, "Quiet you!")
end
if(chance == 2)then
Unit:Emote(15, 0)
Unit:SendChatMessage(14, 0, "I don't care!")
end
if(chance == 1)then
Unit:Emote(29, 0)
Unit:SendChatMessage(14, 0, "You sure about that?")
end
end
RegisterUnitEvent(guard, 18, "guardshout")
I = ubernoob. I'm brain-locked. I need to use chance for both functions, and it needs to recycle its self every time. Maybe I'm just overlooking something. I really appreciate any help.