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

Tool transfer error?

Asked by 8 years ago

Trying to give tools to certain players. Tools are in the ServerStorage already. No errors appear or anything, not sure what's wrong. I've tried changing "Player" to my name as well, it doesn't work no matter what I try. All out of ideas.

Allowed = {"Player"}

local MK48 = game.ServerStorage["Mk-48"]
local MK17 = game.ServerStorage["Mk-17"]
local EV = game.ServerStorage["Explosive vest"]

function onPlayerSpawned(p)
for _,v in pairs(Allowed) do
if p.Name:lower() == v:lower() then
MK48:clone().Parent = p.Backpack
MK17:clone().Parent = p.Backpack
EV:clone().Parent = p.Backpack
end
end
end

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function()
onPlayerSpawned(p)
end)
end)
0
Your script is in a LocalScript or in a Script and what's the parent of the Script XToonLinkX123 580 — 8y
0
Parent is the workspace, regular script. Arceus3317 10 — 8y
0
Because its working for me or change that for Allowed = {"Player", "Player1"} XToonLinkX123 580 — 8y

Answer this question