generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: problem with script

Previous Thread :: Next Thread 
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
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 is not online. YumERAGON
Joined: 18 Apr 2012
Total Posts: 3893
14 Mar 2014 06:54 PM
(click) not (click

stop trolling
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
14 Mar 2014 06:56 PM
im not trolling
I'm just stupid and don't recognize these things
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
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 is not online. 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
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
14 Mar 2014 06:58 PM
one more what?
this isn't even a troll
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
14 Mar 2014 07:29 PM
If you're trying to change GUIs, you would have to do it in the player.
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
14 Mar 2014 07:30 PM
alright, thank you :)
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
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
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
15 Mar 2014 10:49 AM
ermagerd I can't figure this out
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image