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

How to do this when you step on a part you get a thing?

please tell im stupid local function onTouch(Part) print("Touch started: " .. Part.Name) numTouchingParts = numTouchingParts + 1 tl.Text = numTouchingParts end

local function onTouchEnded(Part) print("Touch ended: " .. Part.Name) numTouchingParts = numTouchingParts - 1 tl.Text = numTouchingParts end

Part.Touched:Connect(onTouch) if canGive == false then canGive = true local clone = tool:Clone() clone.Parent = Player.Backpack wait(1) canGive = false end

Part.TouchEnded:Connect(onTouchEnded)

1 answer

✓ Accepted answer

Next time use a code block.

Put your tool in ReplicatedStorage.

local tool = ReplicatedStorage.Tool

script.Parent.Touched:Connect(function()
    tool.Clone(). Parent = player.Backpack
end

Make sure to find the player as I can't do everything for you. I hope this helps. :)

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