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)

3 comments
how do you expect anyone to be able to read it like that..
Please don't just post a large block of code without any formatting, explanation, or context. Please include the output, put your code in a code block, correctly format it, mention things like if it's a local script or a server script, etc. Help us help you.
Idented code posted as answer, hope it helps someone