I made a script that gives me or the solo test "Player" a tool when they join a game. However, it doesn't work, and the output doesn't tell me anything. Here is the script.
local Players = game:GetService("Players")
function onPlayerAdded(player)
local l = game.ServerStorage.LASM:Clone()
if player.Name == "Wizardel" or player.Name == "Player" then
l.Parent = player.Backpack
end
end
Players.PlayerAdded:connect(onPlayerAdded)
for _,player in pairs(Players:GetPlayers()) do
onPlayerAdded(player)
end
I need the
for _,player in pairs(Players:GetPlayers()) do
onPlayerAdded(player)
end
bit so that it works in Solo Test mode. Can anybody help?

1 comment
Except it's not, It's called "Player" whenever I test it. Also, it doesn't work for me in online mode.