CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
|
| 17 Dec 2012 09:18 PM |
levels = {"1","2","3","4","5","6","7","8"}
script.Parent.Changed:connect(function(property) if property == "Text" then local text = script.Parent local player = script.Parent.Parent.Parent.Parent.Parent local character = player.Character for _,levels in pairs(levels) do if text.Text == levels then character:MoveTo(Game.Workspace["Stage"..tostring(text.Text)].SpawnLocation.CFrame.p) text.Text = "Success" wait(1.5) text.Text = "#" else text.Text = "Failed" -- LINE 15 wait(1.5) text.Text = "#" end end end end)
First when I enter a number, say 5, it says "Failed" in the box, the text doesn't go back to "#", and also freezes my character, but I'm still able to move around. Suggestions? |
|
|
| Report Abuse |
|
|
| |
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
| |
|
|
| 17 Dec 2012 09:20 PM |
levels = {"1","2","3","4","5","6","7","8"} local scripting = false
script.Parent.Changed:connect(function(property) if property == "Text" and not scripting then scripting = true local text = script.Parent local player = script.Parent.Parent.Parent.Parent.Parent local character = player.Character for _,levels in pairs(levels) do if text.Text == levels then character:MoveTo(Game.Workspace["Stage"..tostring(text.Text)].SpawnLocation.CFrame.p) text.Text = "Success" wait(1.5) text.Text = "#" else text.Text = "Failed" -- LINE 15 wait(1.5) text.Text = "#" end end scripting = false end end)
The problem was the fact that you kept changing the Text property, which ran the event again and again and again. Adding a debounce will fix this. |
|
|
| Report Abuse |
|
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
|
| 17 Dec 2012 09:31 PM |
asldkfja;skdjf It works about 10% of the time. And the only times it has worked was when I teleported to 1. Not to mention it doesn't even function when playing online mode. :/ Why is this giving me so much troubles? |
|
|
| Report Abuse |
|
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
|
| 17 Dec 2012 09:32 PM |
Forgot to mention, I type in '1', then it says success, I try it again, it says success then failed. Then after it says failed it never works until I reset
|
|
|
| Report Abuse |
|
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
|
| 17 Dec 2012 09:46 PM |
| Nevermind I give up I'll just make chat commands, that's much easier. I'll come back to this another day. |
|
|
| Report Abuse |
|
|