local player = game.Players.LocalPlayer local character = game.Players.LocalPlayer.Character local playerfolder = game.Players.LocalPlayer:WaitForChild("playerfolder") local afk = playerfolder:WaitForChild("afk") local button = script.Parent
button.MouseButton1Click:Connect(function()
afk.Value = not afk.Value
local ff = Instance.new("ForceField")
print(afk.Value)
if afk.Value == true then
ff.Parent = character
wait(1200)
ff:Destroy()
player:kick('You have been AFK for longer than 20 mins')
else
ff:Destroy()
end
end)
Just Identing his code...
local player = game.Players.LocalPlayer local character = game.Players.LocalPlayer.Character local playerfolder = game.Players.LocalPlayer:WaitForChild("playerfolder") local afk = playerfolder:WaitForChild("afk") local button = script.Parent button.MouseButton1Click:Connect(function() afk.Value = not afk.Value local ff = Instance.new("ForceField") print(afk.Value) if afk.Value == true then ff.Parent = character wait(1200) ff:Destroy() player:kick('You have been AFK for longer than 20 mins') else ff:Destroy() end end)
This is not the answer, just helping the ones that want to help