-- 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

8 comments
I understand that if plr is a number but plr is a string value with the players name. So wouldnt the brackets be unnecessary?
no, the brackets tell the script that you are locating an object with the name of (string value)
It gave me the error: 9: '' expected near '['
where is the script located, this will give me an idea of what you are trying to do
its inside a tool that a player has. once player throws the ball a which is a string value would store the player who throws it.
In other words plr and player varaibles are string values with the name of the players. This is also why i feel like the brackets are unneccary
The brackets are necessary. Let me explain. When you are trying to locate the player you want to find the players whose name is equal to the plr variable. This won't work unless you put the brackets around it. What the brackets do, is tell the script: alright so i'm here and now i need to find the person who's name is stored in plr variable. As for the error in your script, I believe there might b
be stored from another script