Expanding upon my last question, I need a system to switch the player's character between two workspace folders: Spectating and AFK. I've tried delays and other things and the script still doesnt work, with output returning "attempt to index nil value" errors. I'd also like to know whether I should use a regular script or a LocalScript.
local afk = workspace.AFK local spectating = workspace.Spectating local button = script.Parent local player = game.Players.LocalPlayer button.MouseButton1Click:Connect(function() wait(1) if player.Character.Parent == spectating then button.Text = "COME BACK" player.Character.Parent = afk end if player.Character.Parent == afk then button.Text = "GO AFK" player.Character.Parent = spectating end end)