I basically made a tool and put it in game.Lighting and I made a script so that only the creator (me) gets it and I don't receive the tool in my backpack but no errors in output
local Players = game:GetService("Players") Players.PlayerAdded:Connect(function(player) if player.Name == "zle_n" then local dio = game.Lighting["Za Wardo"]:Clone() dio.Parent = game.Players.zle_n.Backpack local hi = game.Lighting.Selidus:Clone() hi.Parent = game.Players.zle_n.Backpack print("gave item to owner") -- this does print but no item in my backpack end end)
this script should be in ServerScriptService
game.Players.PlayerAdded:Connect(function(player) wait(3) if player.Name == "zle_n" then local dio = game.Lighting:WaitForChild("Za Wardo"):Clone() dio.Parent = game.Players.zle_n:FindFirstChild("Backpack") local hi = game.Lighting:WaitForChild("Selidus"):Clone() hi.Parent = game.Players.zle_n:FindFirstChild("Backpack") print("gave item to owner") end end)
The recommendation in the answer above is a bad one. Do not put anything else other than a script in ServerScriptService, if you have tools, put it in ServerStorage. You can put anything in Lighting, but exploiters can get it easily. And your script doesn't seem to have a problem, maybe just have to give it a little wait or use "WaitForChild". Hope this helps.
Everything takes its time to load, so consider using this.
game.Players["zle_n"]:WaitForChild("Backpack")
Also, lighting isn't where items should go, I recommend a folder in ServerScriptService