My goal is to be able to set a tool down on a table/counter area as a normal model, that could then be clicked on and picked up by someone else. Kinda like a restaurant system.
Not sure how I would go about starting this?
My goal is to be able to set a tool down on a table/counter area as a normal model, that could then be clicked on and picked up by someone else. Kinda like a restaurant system.
Not sure how I would go about starting this?
First I would check if the tools parent is someone’s character or their backpack.
I did this for my lantern tool in my game. I actually made a transparent part (ClickerPart) that was larger than the lantern model. Inside this part, I inserted a ClickDetector and a Script. Here is the script:
local tool = game.ServerStorage["Lantern"]
local giver = script.Parent
local canGive = false
local function GiveTool(player)
if canGive == false then
canGive = true
local clone = tool:Clone()
clone.Parent = player.Backpack
wait(1)
canGive = false
end
end
giver.ClickDetector.mouseClick:Connect(function(player)
GiveTool(player)
end)
This works because I also have the lantern tool in my ServerStorage. So, the script functions as following:
Make sure to replace “Lantern” with whatever the tool name is in your ServerStorage.