Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a "Click Giver"?

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

✓ Accepted answer

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)

2 comments

0

thanks, i would approve the answer but some jerk keeps devoting me every time i post... But it really did help so thanks

0

No Problem! You Just taught me something new by giving me the part you did!

This discussion is preserved as it was. New answers, comments, and votes are closed.