RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make the model shake, fall, dissapear and reset, 2 seconds after the player stands on it"
-- script for model local part = script.Parent.BasePart local model = script.Parent local debounce = true local function shakeModel() for i = 1, 20 do model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * CFrame.fromEulerAnglesXYZ(math.random(-5, 5) / 100, math.random(-5, 5) / 100, math.random(-5, 5) / 100)) wait(0.05) end end local function resetModel() model:SetPrimaryPartCFrame(CFrame.new(model:GetPrimaryPartCFrame().Position)) end local function onTouched(otherPart) local player = game.Players:GetPlayerFromCharacter(otherPart.Parent) if player and debounce then debounce = false shakeModel() wait(2) model:BreakJoints() model.Transparency = 1 wait(2) resetModel() model.Transparency = 0 debounce = true end end part.Touched:Connect(onTouched)