I want my camera shake script to work
My camera shake works fine in play solo, but it gave me a weird error on team test.
I’ve tried re coding the script and it didn’t work
this was the error
THis is the code
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")
local CameraShaker = require(ReplicatedStorage:WaitForChild("CameraShaker"))
local ShakeRemote = ReplicatedStorage:WaitForChild("ShakeRemote")
local Camera = Workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer
local CameraShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(ShakeCFrame)
Camera.CFrame = Camera.CFrame * ShakeCFrame
end)
CameraShake:Start()
ShakeRemote.OnClientEvent:Connect(function(Position)
if (LocalPlayer.Character:WaitForChild("HumanoidRootPart").Position - Position).magnitude <= 50 then
CameraShake:Shake(CameraShaker.Presets.Explosion)
end
end)
It’s working fine and no error on play solo but when I play on team test I got this error
I think it is due to the nature of how teamtest works, it is very weird. If it works in the simulation (not teamtest) and if you publish it and it works, there should be no problems. Probably a bug in teamtest.