script.Parent.MouseButton1Click:Connect(function(click)
print("hi")
script.Parent.Button:Play()
local player = game.Players:WaitForChild("LocalPlayer")
local afk = player.Afk
print(afk.Value)
if game.Players.Afk.Value == false then
game.Players.LocalPlayer.Afk.Value = true
script.Parent.Text = "UnAfk"
if game.Players.LocalPlayer.Afk.Value == true then
game.Players.LocalPlayer.Afk.Value = false
script.Parent.Text = "Afk"
end
end
end)
local button = script.Parent
local afk = player.Afk
local player = game.Players.LocalPlayer
button.MouseButton1Click:Connect(function()
if player.Afk.Value == false then
afk.Value = true
button.Text = "UnAfk"
elseif player.Afk.Value == true then
afk.Value = false
button.Text = "Afk"
end
end)```