script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Text == "Go AFK" then
game.Players.LocalPlayer.TeamColor = BrickColor.new("Smoky grey")
game.Players.LocalPlayer:LoadCharacter()
local Boi = script.Parent
Boi.Text = "Turn off AFK"
end
if script.Parent.Text == "Turn off AFK" then
game.Players.LocalPlayer.TeamColor = BrickColor.new("White")
game.Players.LocalPlayer:LoadCharacter()
local Boi = script.Parent
Boi.Text = "Go AFK"
end
end)
This script is a local script under a button.
When someone clicks the button, everything works except the fact that the text of the button doesn't change. This messes up everything as the script needs the button to have a diffrent text once someone clicks to Turn off AFK.
Why doesn't the text change?
EDIT: I Solved it, went to starter gui and un checked the refresh GUI after death.

3 comments
I know i'm having problems with LocalScripts too, but due to my knowledge, i dont know how to fix it but i do know that "LocalPlayer" is being annoying to me as well. So idk man, sorry!
What is the buttons text?
It starts off as Go AFK