Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

How do i make this loop?

Asked by 9 years ago

script.Parent.MouseClick:connect(function(plr)

local c = game.Lighting.Apple:Clone()

c.Parent = plr.Backpack

end)

script.Parent.MouseClick:connect(function(plr)

local c = game.Lighting.Apple:Clone()

c.Parent = plr.Backpack

script.Parent.Parent:remove()

end)

how do i make this happen over and over? every time the tree is clicked i want to have a delay of 2 minutes before the tree to reappears... can u help?

0
You may want to put the apple in ServerStorage, it is way more stable. ChipioIndustries 454 — 9y

1 answer

Log in to vote
-1
Answered by 9 years ago
Trees = game.ServerStorage.Trees:GetChildren() -- Put a few trees in server storage


Tree = script.Parent.Parent -- This script would be inside the trunk!
script.Parent.ClickDetector.MouseClick:connect(function()
Tree:Destroy()
wait(120)
c = Trees[math.random(1, #Trees)]
c.Parent = workspace


end)
0
it didnt work but ill see if i can get it to work FastSnail5 8 — 9y
0
it worked for me Timster111 25 — 9y
0
does it need to be in a script or a local script FastSnail5 8 — 9y
0
Script.... Here is a link to the model I made for you! http://www.roblox.com/Tree-Click-System-For-FastSnail5-item?id=184779369 Timster111 25 — 9y
View all comments (3 more)
0
Whoops Let me update it I forgot to clone it! Timster111 25 — 9y
0
There you go! Timster111 25 — 9y
0
thanks FastSnail5 8 — 9y
Ad

Answer this question