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 » Scripters
Home Search
 

Fixing Script

Previous Thread :: Next Thread 
sillyboy668 is not online. sillyboy668
Joined: 26 Sep 2009
Total Posts: 30
17 Feb 2016 11:26 AM
This works but it says Time Took when you touch it the first time, I tried tweaking it but it made it worse. I need to make it count and then pause and say Time Took when you touch it the second time.

local h = Instance.new("Hint")

local start = 0

h.Parent = game.Workspace

function onTouched(hit)
for i = 1,999 do
h.Text = i
wait(1)

while hit.Touched:wait() do
local i = 1
h.Text = "Time it Took: "..i
wait(1)
i = i + 1
end

end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
admin002 is not online. admin002
Joined: 09 Apr 2008
Total Posts: 887
17 Feb 2016 11:38 AM
Untested, but give it a shot:

local h = Instance.new("Hint")

local start = 0

h.Parent = game.Workspace

touchedOnce = false

i = 1;

function onTouched(hit)
if touchedOnce == false then
for i = 1,999 do
h.Text = i
wait(1)
i = i + 1
touchedOnce = true
end
else
while hit.Touched:wait() do
h.Text = "Time it Took: "..i
touchedOnce = false
i = 1
wait(1)
end
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
admin002 is not online. admin002
Joined: 09 Apr 2008
Total Posts: 887
17 Feb 2016 11:40 AM
Actually I doubt that'll work. The loop will probably be blocking.
Report Abuse
sillyboy668 is not online. sillyboy668
Joined: 26 Sep 2009
Total Posts: 30
19 Feb 2016 04:04 PM
Thanks for trying to help but it doesn't work. Anyone else care to try to make it work? please.
Report Abuse
killerbot29003 is not online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
19 Feb 2016 04:28 PM
Can you explain what you're trying to do?




This siggy is copyrighted ©



Report Abuse
sillyboy668 is not online. sillyboy668
Joined: 26 Sep 2009
Total Posts: 30
21 Feb 2016 08:45 AM
I'm trying to get the script to count up in 1's when you touch it first. Then when you touch it once again it stops on the digit you touched it and says something like "Time it took: (digit)
Report Abuse
sillyboy668 is not online. sillyboy668
Joined: 26 Sep 2009
Total Posts: 30
21 Feb 2016 04:30 PM
Help please?
Report Abuse
sillyboy668 is not online. sillyboy668
Joined: 26 Sep 2009
Total Posts: 30
21 Feb 2016 05:08 PM
Bump
Report Abuse
sillyboy668 is not online. sillyboy668
Joined: 26 Sep 2009
Total Posts: 30
21 Feb 2016 05:57 PM
Help...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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