So I'm bad at scripting And I made a camera Shake Script(For a Horror Game) But I want it to activate when I enter a room Any Help Would be Thankful Thanks! Edit: And When its activated and you step on it again it stops
math.randomseed(tick()) local runService = game:GetService("RunService") local char = script.Parent local hum = char:WaitForChild("Humanoid") local nextFire = 0 local shakeRate = 0 local shakeMin = 100 local shakeMax = 200 runService.RenderStepped:Connect(function() if elapsedTime() > nextFire then nextFire = elapsedTime() + shakeRate hum.CameraOffset = Vector3.new(math.random(shakeMin, shakeMax)/1000, math.random(shakeMin, shakeMax)/1000, math.random(shakeMin, shakeMax)/1000) end end)