Hello , I Need Help With My Code!
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:wait() if wait(5) then game.Lighting:FindFirstChild("SkullSword"):Clone().Parent = player.Backpack end end)
Its Not Working Please Help Me. Thank You! Btw I Am New To LUA
First, make sure this is a Server Script inside of ServerScriptService
.
Now let me re-write your code;
game.Players.PlayerAdded:Connect(function(p) -- use connect with a cap C p.CharacterAdded:Wait() wait(5) local CT = game.Lighting:WaitForChild("SkullSword"):Clone() -- we use waitforchild to wait untill it loads in CT.Parent = p.Backpack end)
Try this code. It may or may not solve your problem. I don't see any other problems here. Here's a few stuff you can do if it still doesn't work;
- Make sure you got the name of the sword correct
- Add variables for the sword
- change the location of "SkullSword" to
ReplicatedStorage
- re - write your code
I'm sure one of these should help.
Good luck and have fun developing!