Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago
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"

0
try arrow.Parent = plr:FindFirstChild("Backpack") ninjabluekris -4 — 3y
0
First of all you should add a wait for the debounce or it doesn't serve any purpose. RedstonePlayz09 0 — 3y

1 answer

Log in to vote
2
Answered by 3 years ago

Is the localscript located in the workspace ? if it is then the localscript wont run

see this article

Ad

Answer this question