local RoundEndV = game.Lighting.Variables.HandleGameVariables.RoundEnd local Winner = game.Lighting.Variables.ActiveGameVariables.Winner RoundEndV.Changed:Connect(function() if RoundEndV.Value == true then if game.Players.LocalPlayer.Character == game.Lighting.Variables.ActiveGameVariables.Winner.Value then script.Parent.RoundWin.Visible = true -- Gui for the local player to win else script.Parent.RoundLose.Visible = true -- Gui for the local player to lose (not the winner) end end end)
My script isn't working that is supposed to say "you win" when you are the one who wins the round. If you win the round, which I have a variable for the winner a GUI should say "you win". But It just says "you lose" whenever I complete the objective in my game.
If you need more explanation please ask me!
Here is your problem:
if game.Players.LocalPlayer.Character == game.Lighting.Variables.ActiveGameVariables.Winner.Value then
When seeing if the players name is equal to the string variable just do
if game.Players.LocalPlayer.Name == game.Lighting.Variables.ActiveGameVariables.Winner.Value then
By comparing the character you are only getting a bool value to see if it exist. (True if it is there and False If it isnt) So just call for the players name.