script.Parent.MouseClick:connect(function(plr)
local c = game.Lighting.Apple:Clone() c.Parent = plr.Backpack
end)
So I kind of asked this question earlier i suppose. anyways Timster111 helped me come this far with my script but now I need a tree that i already have in my game to give the character the apple only 2 times per 5 minutes. can anyone help me?
while true do wait(300) -- amount of seconds for this to happen local c = game.Lighting.Apple:Clone() c.Parent = plr.Backpack end
Try that, might work.
beginner scripter ywis
Maybe this?
local clock = 0 function giveApple() for i=1, 2 do local apple = game.Lighting.Apple:clone() apple.Parent = plr.Backpack end end --if you want it to give them an apple right away, just put giveApple() here while wait(1) do clock = clock + 1 if clock == 300 then giveApple() clock = 0 end end
That should work, although I can't test it right now.