|
| 06 Apr 2012 09:08 PM |
I think the problem here is that my script keeps checking the whole script before that part is activated. If I said !start battleteam, it's reading the elseif part as well and not working when I say !end battleteam. Help? D:
started = false
function checkToLetIn(name) for i = 1,#_G.admins do if (string.upper(name) == string.upper(_G.admins[i])) then return true end end return false end
function onChatted(msg, recipient, speaker) local source = string.lower(speaker.Name) if (checkToLetIn(source)) then if msg == "!start battleteam" and started == false then script.Parent.Transparency = 0.1 wait(0.1) script.Parent.Transparency = 0.2 wait(0.1) script.Parent.Transparency = 0.3 wait(0.1) script.Parent.Transparency = 0.4 wait(0.1) script.Parent.Transparency = 0.5 wait(0.1) script.Parent.Transparency = 0.6 wait(0.1) script.Parent.Transparency = 0.7 wait(0.1) script.Parent.Transparency = 0.8 wait(0.1) script.Parent.Transparency = 0.9 wait(0.1) script.Parent.Parent = game.Lighting started = true elseif msg == "!end battleteam" and started == true then script.Parent.Parent = game.Workspace newDoor.Transparency = 0.9 wait(0.1) newDoor.Transparency = 0.8 wait(0.1) newDoor.Transparency = 0.7 wait(0.1) newDoor.Transparency = 0.6 wait(0.1) newDoor.Transparency = 0.5 wait(0.1) newDoor.Transparency = 0.4 wait(0.1) newDoor.Transparency = 0.3 wait(0.1) newDoor.Transparency = 0.2 wait(0.1) newDoor.Transparency = 0.1 wait(0.1) newDoor.Transparency = 0 started = false end end end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
| |
|
GoldenUrg
|
  |
| Joined: 23 Aug 2009 |
| Total Posts: 6428 |
|
|
| 06 Apr 2012 10:57 PM |
That warning won't bother you. But moving your script to Lighting will stop it from running anymore.
|
|
|
| Report Abuse |
|
|
| |
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
| |
|
|
| 07 Apr 2012 04:45 AM |
I was gonna, then I just noticed once I was done, so it doesn't matter. :P
for i = 1, 9 game.Workspace.fieldForceField.Transparency = game.Workspace.fieldForceField.Transparency - 0.1 wait(0.1) end |
|
|
| Report Abuse |
|
|