Help solve the problem of Obesity with scripting!?
Helping me with this script will help me complete my game, which promotes fruit, which will help the problem of obesity!
This script is meant to:
Load when picking a fruit; showing as a loading bar
Once loaded give the fruit/ xp, etc...
This script works until the player lifts the button up. Then it still does done() and does it in the background until you try and pick another fruit where it gives you a load of fruit at the same time, then randomly gives you fruit...
Yeah, it's really messed up. I have no idea why could you help me make this place awesome? Credit will be given! :D
Place: http://www.roblox.com/Nature-V-0-02-place?id=139229308
01 | local fruit, fruitTop, x, y, z, done = script.Parent, script.Parent.Fruit, false , true , true , false |
04 | script.Parent.ClickDetector.MouseClick:connect( function (plr) |
08 | barframe = plr.PlayerGui.ProgressBar.Frame |
10 | pick = plr.PlayerGui.ProgressBar.Pick |
14 | pick.MouseButton 1 Down:connect( function () |
17 | barframe.Visible = true |
20 | while z = = true and y = = false do |
21 | for size = 0 , 1 , 0.015 do |
23 | bar.Size = UDim 2. new(size, 0 , 1 , 0 ) |
25 | bar.Size = UDim 2. new( 0 , 0 , 1 , 0 ) |
26 | barframe.Visible = false |
32 | bar.Size = UDim 2. new( 0 , 0 , 1 , 0 ) |
33 | barframe.Visible = false |
43 | pick.MouseButton 1 Up:connect( function () |
45 | bar.Size = UDim 2. new( 0 , 0 , 1 , 0 ) |
46 | barframe.Visible = false |
end)