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.

4 comments

0

It's not working because ReplicatedStorage was never defined, so the variable is nil. Use game:GetService("ReplicatedStorage").Events.MoveModel.

0

Sorry I forgot to mention that part of the script inside this question. ReplicatedStorage is defined.

0

Also, Filtering Enabled

0

Check output for errors