Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is FireAllClients() not working in this situation?

Asked by 5 years ago

My code:

--// Server Script -

spawn(function()
local event = ReplicatedStorage.Events.MoveModel
while ServerDebounces[plr] == true do
wait()
event:FireAllClients()
end
end)

--// Local Script -

local event = ReplicatedStorage.Events.MoveModel

event.OnClientEvent:Connect(function()
game:GetService("RunService").RenderStepped:Connect(function()
if Debounce == true then return end
Char.Block.CFrame = Char.Block.CFrame:lerp(Char.HumanoidRootPart.CFrame*CFrame.new(0,0,-3), 1)
end)
end)

The code above works for me, but when I am playing with others, it falls through the ground and does not lerp to the given cframe. I have tried to anchor it, but this makes the block unable to deal damage.

0
It's not working because ReplicatedStorage was never defined, so the variable is nil. Use game:GetService("ReplicatedStorage").Events.MoveModel. DeceptiveCaster 3761 — 5y
0
Sorry I forgot to mention that part of the script inside this question. ReplicatedStorage is defined. Mellodax 2 — 5y
0
Also, Filtering Enabled theking48989987 2147 — 5y
0
Check output for errors gullet 471 — 5y

Answer this question