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

How to make a part that when a player clicks on it, it gives them a tool?

Hi guys! I need some help here. Is there any way I can make a part that when a player clicks on it, it will give them a tool.

(BTW, the tool's name is "Cup")

I hope that some of you will help me with this. Thanks if you do! :D

1 answer

✓ Accepted answer

Make sure to put the tool, "Cup" under ReplicatedStorage. Paste the code down below into a script thats under the part:

local cd = Instance.new("ClickDetector")
cd.Parent = script.Parent

cd.MouseClick:Connect(function(Plr)
	local cup = game.ReplicatedStorage.Cup:Clone()
	cup.Parent = Plr.Backpack
end)

3 comments

0

Please accept if this helped!

0

If you only want the player to be able to click it onces, add 'Script:Destroy" after line 6

0

Downvoted because this supports requests

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