ServerScriptService.FootBallEngine:24: attempt to index nil with 'Value'

Hello,
I am creating my football game on roblox and I launched afterwards and its put ServerScriptService.FootBallEngine: 24: attempt to index nil with ‘Value’,
suddenly I saw topics in the same subject but that doesn’t help me,
you can help me,
here is the script:

game.Players.PlayerAdded:Connect(function(plr)
local team = Instance.new(“IntValue”)
team.Name = “Team”
team.Parent = plr
team.Value = 0
local Zone = Instance.new(“StringValue”)
Zone.Parent = plr
Zone.Name = “Zone”
Zone.Value = “”
plr.CharacterAdded:Connect(function()
wait(0.1)
if klq == false then
plr.Character:MoveTo(game.Workspace.TeleportSpawn.Position)
klq = true
else
if plr.Team.Value == 1 then
return game.Workspace.TeamPlacement.Blue:WaitForChild(plr.Zone.Value).Position
else
if plr.Team.Value == 2 then
return game.Workspace.TeamPlacement.Red:WaitForChild(plr.Zone.Value).Position
end
end
end
end)
end)

1 Like

change it to:

if team.Value = 1 then

since there’s already a variable for it

1 Like

:heart:Oops, thank you, I forgot

1 Like