RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"I want the person to be able to sit first then for it to explode after 3 seconds"
```lua local chair = script.Parent local canSit = true local function explode(part) local explosion = Instance.new("Explosion") explosion.Position = part.Position explosion.Parent = game.Workspace end local function sitCooldown() canSit = false wait(3) -- wait for 3 seconds canSit = true end for _, part in ipairs(chair:GetChildren()) do if part:IsA("BasePart") then part.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid and canSit then sitCooldown() wait(3) -- wait for 3 seconds before explosion explode(part) end end) end end ``` In this script, we've added a 3 second delay before the explosion happens after the player sits on the chair. The `wait(3)` function will pause the script for 3 seconds, allowing the player to sit on the chair first before it explodes.