pad1 = workspace["Open me"].Stop pad = workspace["Open me"].Start pad.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) local Playing = plr.Playing Playing.Value = true end pad1.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) local Playing = plr.Playing Playing.Value = false wait(3) Playing:destroy() end end)
Error: Players.xp5u.PlayerScripts.LocalScript:22: Expected 'end' (to close 'function' at line 3), got <eof>; did you forget to close 'then' at line 12? - Studio - LocalScript:22
Remove the closing parenthesis on line 22 so it just says "end" not "end)".
At line 10 you got just an end, you need another end) to close the first touched event.