This script looks correct to me, I may be wrong but the error is showing at the end.
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if player.Name == "SomeDude" then print("Hi") if player.Name == "SomeOtherDude" then print("Hi") end end) --//It shows the error here end)
The error in the output is:
15:05:47.597 - ServerScriptService.OverheadGui:20: Expected identifier when parsing expression, got ')'
You missed the end in your first statement:
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if player.Name == "SomeDude" then print("Hi") end -- Missed the end here. if player.Name == "SomeOtherDude" then print("Hi") end end) end)
You can also use an elseif statement:
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if player.Name == "SomeDude" then print("Hi") elseif player.Name == "SomeOtherDude" then print("Hi") end end) end)
If you have any issues, feel free to comment back.
fix:
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if player.Name == "SomeDude" then print("Hi") end if player.Name == "SomeOtherDude" then print("Hi") end end) end)
That's because you cancel the end from your first if so for e.g.
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if player.Name == "SomeDude" then end print("Hi") if player.Name == "SomeOtherDude" then print("Hi") end end) end)
And remove the bracket on line 10