|
| 14 Mar 2014 06:53 PM |
What is supposed to happen is; when you click the script.Parent, "swagger" minuses 1 until it reaches 0. (starting from 10)
function click() swagger=script.Parent.Parent.Timer.Text
while tonumber(swagger)>0 do wait(1) swagger = swagger - 1 end end script.Parent.MouseButton1Click:connect(click
No output |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 14 Mar 2014 06:54 PM |
(click) not (click
stop trolling |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2014 06:56 PM |
im not trolling I'm just stupid and don't recognize these things |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2014 06:57 PM |
oh and, the ) is there on the real script, I just forgot to paste it here |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 14 Mar 2014 06:57 PM |
| one more and ill report so dont even think about another thread |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2014 06:58 PM |
one more what? this isn't even a troll |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2014 06:59 PM |
You referenced the .Text property in the variable, so 'swagger' will always be whatever it first was, and you cannot change it.
function click() swagger=script.Parent.Parent.Timer
while tonumber(swagger.Text)>0 do wait(1) swagger.Text = tostring(tonumber(swagger.Text) - 1) end end script.Parent.MouseButton1Click:connect(click) |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2014 07:02 PM |
thanks KnightmareXD
Do you know how I can make it so that when someone continually clicks the button, it doesn't increase the speed swagger.Text goes down?
|
|
|
| Report Abuse |
|
|
|
| 14 Mar 2014 07:05 PM |
Adding something dubbed a 'debounce' should work. The basic logistics should work like:
local Clicked = false
function click() if Clicked then return end Clicked = true swagger=script.Parent.Parent.Timer
while tonumber(swagger.Text)>0 do wait(1) swagger.Text = tostring(tonumber(swagger.Text) - 1) end Clicked = false end script.Parent.MouseButton1Click:connect(click)
It should only run the loop again after it is finished. |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2014 07:27 PM |
thanks :)
how can I make it return to the beginning screen after it hits 0?
if tonumber(swagger.Text) == 0 then script.Parent.Visible = false script.Parent.Parent.TextButton.Visible = true script.Parent.Parent.Timer.Visible = false swagger.Text = "10" end
Should I create a new script inside of Timer? or can I include this inside of this current script |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2014 07:29 PM |
| If you're trying to change GUIs, you would have to do it in the player. |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Mar 2014 08:30 PM |
with doing it in the player, I'll need a local script, right? I've tried like 50,000 different arrangements and I can't figure out how I should line everything up |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2014 10:49 AM |
| ermagerd I can't figure this out |
|
|
| Report Abuse |
|
|