RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"script a chair sit"
-- local script (StarterGUI) local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local chair = workspace:FindFirstChild("Chair") -- Make sure the chair is named "Chair" in the workspace if not chair then print("No chair found.") return end local seat = chair:FindFirstChild("Seat") if not seat or not seat:IsA("Seat") then print("No seat found.") return end local function sitDown() if humanoid.Sit then humanoid.Sit = false else humanoid.Sit = true humanoid.MoveTo(seat.Position) end end seat.Touched:Connect(function(hit) if hit.Parent and hit.Parent:IsA("Model") and hit.Parent:FindFirstChild("Humanoid") then sitDown() end end)