Why isn't player not a valid member of datamodel?
Asked by
6 years ago Edited 6 years ago
Since I didn't want players to be able to spectate while they are in a match I created if statements; however, that isn't the problem. The problem is that in order to create the if statement clearer or easier I created variables.
Here is a script inside of the spectate gui:
1 | gui = script.Parent.Button |
3 | local IsInMatch = game.player.IsInMatch.Value |
5 | if IsInMatch = = true then |
7 | elseif IsInMatch = = false then |
Each player has a BoolValue (IsInMatch) and changes from false to true when the player is in a match or dies.
Here is my output window of the problem:
player is not a valid member of DataModel
Inside of every spawn is a function when the player touches the part and then it sets the value of IsInMatch to true or false.
I am confused by what this means. Please help me out! What is the problem? What do I have to change?
BTW I am new to scripting so thanks!
If you think the problem is something else, and let me know.