Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 2 months ago
Edited 2 months 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 — 2mo
0
First of all you should add a wait for the debounce or it doesn't serve any purpose. RedstonePlayz09 0 — 2mo

1 answer

Log in to vote
2
Answered by 2 months ago

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

see this article

Ad

Answer this question