Huh? Can someone explain why this isnt working?
local module = {}
function module.SmallShake(character : Model, duration : number)
if character == nil or duration == nil then
return
end
local Humanoid = character:FindFirstChild("Humanoid")
task.spawn(function()
local StartTime = os.time()
repeat
task.wait()
local EndTime = os.time()
local XOffset = math.random(-50, 50) / 800
local YOffset = math.random(-50, 50) / 800
local ZOffset = math.random(-50, 50) / 800
Humanoid.CameraOffset = Vector3.new(XOffset, YOffset, ZOffset)
until EndTime - StartTime >= duration
Humanoid.CameraOffset = Vector3.zero
end)
end
return module
local lp = game.Players.LocalPlayer
ScreenShake.SmallShake(game.Players.LocalPlayer, 5)
ReplicatedStorage.ScreenShake:22: attempt to index nil with 'CameraOffset' - Client - ScreenShake:22