i want to make it so that when i click on a candle on a table i get that candle
COMMUNITY QUESTION
how do i make it so that when i click on something i get that item i clicked?
1 answer
Make a "Click Detector" and put it under the candle. Then put this Script under the candle:
local clickDetector = script.Parent:FindFirstChild("ClickDetector")
local Clone = game.Workspace.Candle:Clone()
local LocalPlayer = game.Players.LocalPlayer
function onMouseClick()
Clone.Parent = game.Players.LocalPlayer.Backpack
end
clickDetector.MouseClick:connect(onMouseClick)
(this script will only work if the candle is a Tool, if it's not a tool I don't think it's possible to put it in the player's inventory.)
1 comment
0
what if its a group?
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Use a click detector and connect mouse click event, then clone a copy of the tool to player's backpack
what is a mouse click event?
@Alex08l click mouse event is really just something that happens when you click your mouse (someone correct me if i'm wrong)