What is the issue? I don’t know why my script isn’t working.
What solutions have you tried so far? I tried to look at DevForum but i din’t found an solution.
Script:
local ShakeEvent = game.ReplicatedStorage.Events:WaitForChild("HyperScreenShake")
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
ShakeEvent.OnClientEvent:Connect(function(Time)
local StartTime = tick()
repeat
wait()
local EndTime = tick()
local xOffset = math.random(-505,505)/500
local yOffset = math.random(-505,505)/500
local zOffset = math.random(-505,505)/500
Humanoid.CameraOffset = Vector3.new(xOffset, yOffset, zOffset)
until EndTime - StartTime >= Time
Humanoid.CameraOffset = Vector3.new(0, 0, 0)
end)
thats why cuz you cant equal or greater number with nil value show me server or script thats have fire client
there some tips can use it to avoid this error make sure write this
tonumber(Time)
try print type of this value and make sure its number
To add onto this, you should be using os.clock() instead of tick() because it has way more precision down to the nanoseconds. Next, you should be using task.wait() instead of wait() since it’s a lot more reliable and actually works with the task scheduler (and can have lower delays than wait). Now this one is optional but makes things look a little cleaner, but it’s generally better to use Vector3.zero if your gonna be making a zero vector. (much faster to access a property than to construct a whole new object)