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

Make this script only work on LocalPlayer?

Asked by
AmWrath 41
8 years ago

How would I make this script only work on LocalPlayer but still be inside of its part?

local tool = game.ServerStorage.Sword

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(chr)
local function onTouch(part)
    if plr.Backpack:FindFirstChild('Sword') ~= nil then
plr.Backpack:FindFirstChild('Sword'):Remove()
    end
    end

script.Parent.Touched:connect(onTouch) 
    end)
    end)
0
you could make the script clone a localscript? UniversalDreams 205 — 8y
0
You need to reconsider your definition of what the 'LocalPlayer' is in this case User#6546 35 — 8y

Answer this question