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

Giving player a tool from rs when touching a part not working?

local arrow = game.ReplicatedStorage.Arrow:Clone()
local plr = game.Players.LocalPlayer
local debounce = false

script.Parent.Touched:Connect(function()
	if not debounce then
		debounce = true
		arrow.Parent = plr.Backpack
		debounce = false
		end
end)

A tool called "Arrow" will be given to the players backpack when the player touches the part. Not sure why it is not working but i am sure that the fault is with "script.Parent.Touched:Connect(function()". Please help.

Output shows no error at all and this is a local script inside a MeshPart called "Arow"

2 comments

0

try arrow.Parent = plr:FindFirstChild("Backpack")

0

First of all you should add a wait for the debounce or it doesn't serve any purpose.

1 answer

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