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

what wrong with this script?

Hi I was trying to make when a player joins they get a sword. But this doesn't work. Can you help?

local sword = game:GetService("ServerStorage").ClassicSword:clone()

game:GetService("Players").PlayerAdded:connect(function(plyr)
  sword.Parent = plyr.StarterGear
  sword:clone().Parent = plyr.BackPack
end)

2 comments

0

I am not sure, I dont want to test the script in a place, but sword:clone().Parent? I dont think you can use parentheses in a heirarchy string

0

@yogi That is not the case.

1 answer

✓ Accepted answer

If you are running this offline then it is possible that your character loads before the script loads, which would result in PlayerAdded never firing. This should otherwise work online.

3 comments

0

Well the output says StaterGear is not a valid member of player...

0

You should have said that then. Replace that with plyr:WaitForChild("StarterGear")

0

thanks man

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