I am trying to get the player and load it when a player touches it but I get this error: Workspace.Map.LoadChar.Script:5: attempt to index local 'plr' (a nil value)
script.Parent.Touched:connect(function(hit)
local hum = hit.Parent:FindFirstChild('Humanoid')
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if hum then
plr:LoadCharacter()
end
end)
