local clickDetector = script.Parent
local Apple = game.Lighting:WaitForChild("Apple")
script.Parent.MouseClick:connect(function(plr)
if plr.StarterPack then plr.StarterPack:Add(Apple) end
end)
Ok so i have an object called "Apple" in the Lighting section of my game. I am trying to make it where when a player clicks on the tree, it gives the player the apple in the lighting section. I am also trying to make it where you can only get a maximum amount of two apples out of one tree but i dont know how to do that. PLEASE HELP!
And I still dont get why I have -1 On this answer when It actually works!~
script.Parent.ClickDetector.MouseClick:connect(function(plr) c = game.Lighting.Apple:Clone() c.Parent = plr.Backpack end)