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

how do i make it so that when i click on something i get that item i clicked?

i want to make it so that when i click on a candle on a table i get that candle

3 comments

0

Use a click detector and connect mouse click event, then clone a copy of the tool to player's backpack

0

what is a mouse click event?

0

@Alex08l click mouse event is really just something that happens when you click your mouse (someone correct me if i'm wrong)

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.