So I am making a GUI for my game with rounds that has a GUI that is supposed to change when a variable (gamestatusv) is changed to 1 or 2. 1 is for on and 2 is for off.
local gamestatusv = game.ReplicatedStorage:WaitForChild("GameStatus") ---- Location of IntValue in game.
game.gamestatusv.Changed:connect(function() --Function
if game.gamestatusv.Value == "1" then
game.Players.LocalPlayer.PlayerGui.CoinGuessGui.Backs.Visible = true --On
game.Players.LocalPlayer.PlayerGui.CoinGuessGui.Heads.Visible = true
game.Players.LocalPlayer.PlayerGui.CoinGuessGui.Tails.Visible = true
game.Players.LocalPlayer.PlayerGui.TimerGui.Timer.Visible = true
else if gamestatusv.Value == "2" then
game.Players.LocalPlayer.PlayerGui.CoinGuessGui.Backs.Visible = false --Off
game.Players.LocalPlayer.PlayerGui.CoinGuessGui.Heads.Visible = false
game.Players.LocalPlayer.PlayerGui.CoinGuessGui.Tails.Visible = false
game.Players.LocalPlayer.PlayerGui.TimerGui.Timer.Visible = false
end
end
end)
I get the error: "gamestatusv is not a valid member of datamodel" . I am confused and really stuck. How do I fix this? I can provide the location of things if you need me to.

6 comments
Now on line 17 I get a red underline under the end.
add another end
I get the error: expected (to close '(' at line 3) near 'end' || Adding another end doesn't work.
Undoing what B_rnz did fixes it.. But I still get the first error.
Original Error: gamestatusv is not a valid member of DataModel
I'll edit it, wait...