game.ReplicatedStorage:WaitForChild("Lock").OnServerEvent:connect(function(x)
print("Ok, spectator ranking has received the alert. I am now locking the server")
workspace["Auto Team Rank"].Value.Value = true
game.Players[x.Name].PlayerGui:WaitForChild("HostGUI").LockButton.State.Value = true
game.Players.LocalPlayer.PlayerGui.HostGUI.Button.Text = "LOCKED"
end)
I've tried everything to solve the problem but I keep getting the same error.
edit; yes the game has fe on

3 comments
What is the error? Is FE on? I will warn you that if you don't check if the player is allowed to lock a hacker can trigger your event and lock the server.
Yes, FE is on. There aren't any errors but I am getting a "Stack Begin" then mentions of line 4 of the script, then a "Stack End".
Is game FE?