There are a few things wrong with this script and a few things that I wouldn't recommend doing
First thing is that you are getting the Character by looking for an instance with that name in Workspace when you can just get the Character like this Player.Character but you don't even need the Character name you can just use Player.Name I would recommend identifying your Player with Player.UserId though which is what I did below
Second thing is Clone doesn't take any parameters
Third thing is you should use GetService to get Services
Fixed version:
game.Players.PlayerAdded:Connect(function(plr)
if plr.UserId == 160153718 then
local g = game:GetService("ServerStorage").HyperlaserGun:Clone()
g.Parent = plr.Backpack
end
end)
You can read more about the Player Instance here
Please let me know if you are having any problems with this or if there is something you don't understand :)
1 comment
Are there any errors?