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

How do I make a "Click Giver"?

Asked by 10 years ago

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!

1 answer

Log in to vote
-1
Answered by 10 years ago

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)
0
thanks, i would approve the answer but some jerk keeps devoting me every time i post... But it really did help so thanks FastSnail5 8 — 10y
0
No Problem! You Just taught me something new by giving me the part you did! Timster111 25 — 10y
Ad

Answer this question