-- the variable plr should get the players name but for some reason says plr isnt a valid member idk whats wrong :/
a= script.Parent whatever = game.Workspace player = script.Parent.Parent.player.Value wait(1) while true do if whatever.Game.scored.Value == true then if a.Value ~= "" then plr = a.Value if game.Players.plr.TeamColor == game.Players.player.TeamColor then game.Players.plr.scored.Value = game.Players.plr.scored.Value + 1 end end else wait() end end
The script thinks that you are locating an object called plr. To fix this all you have to do is put brackets around the variable like this: [plr]
The dot must go after the brackets not before.
Your script should look a little like this:
a= script.Parent whatever = game.Workspace player = script.Parent.Parent.player.Value wait(1) while true do if whatever.Game.scored.Value == true then if a.Value ~= "" then plr = a.Value if game.Players[plr].TeamColor == game.Players[player].TeamColor then game.Players[plr].scored.Value = game.Players[plr].scored.Value + 1 end end else wait() end end