Client Fly Script Not Replicating the Movement onto the Server (SOLVED)

I don’t have a footage, but this client script was replicating the player movement to other players and the servers before. After changing it, it just stopped doing this.

The issue is, the player’s position is supposed to be always moving from the flying ability. However, it seems to make the player stay in one place instead. To the client you are moving as intentionally, but to other players and the server, the player is just still in that place. (Proven Evident due to the visuals that appear at the player’s character position is shown at the starting point of the flight ability)

I’ve tried removing the part of the code that I adjusted, but nothing’s been working. I’ve been scrolling through the forum and wasn’t able to find anything related. What should I do?

Main Part for the Flight itself. (Local Script):

local BodyPos = Instance.new("BodyPosition", plr.Character.PrimaryPart)
			BodyPos.P = 30000
			BodyPos.MaxForce = Vector3.new(0, 30000, 0)
			BodyPos.Position = plr.Character.PrimaryPart.Position + Vector3.new(0, 12, 0)
			CurBodyPos = BodyPos
			wait(0.4)
			local humanoid : Humanoid = plr.Character.Humanoid
			humanoid.AutoRotate = true
			local bodyGyro = Instance.new("BodyGyro")
			CurBodyGyro = bodyGyro
			bodyGyro.P = 10000
			bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
			curruns = runs.Heartbeat:Connect(function()
				local num = -13
				if HoldingSpace then
					num = -3
				end
				local ray = Ray.new(plr.Character.PrimaryPart.Position, Vector3.new(0, num, 0))
				local hitpart, hitpos, hitnorm = game.Workspace:FindPartOnRayWithIgnoreList(ray, {plr.Character, game.Workspace.Visuals})
				if HoldingSpace == true then 
					CurBodyPos.P = 10000
					if hitpos.Y < seaLevel then
						BodyPos.Position = Vector3.new(0, seaLevel + 10, 0)
					else
						BodyPos.Position = Vector3.new(0, hitpos.Y + 10, 0)
					end
				else
					CurBodyPos.P = 30000
					if hitpos.Y < seaLevel then
						BodyPos.Position = Vector3.new(0, seaLevel + 10, 0)
					else
						BodyPos.Position = Vector3.new(0, hitpos.Y + 10, 0)
					end
				end
				if plr.Character.Humanoid.MoveDirection ~= Vector3.new(0,0,0) then
					local bodyGyroCFrame = CFrame.new(plr.Character.PrimaryPart.Position, plr.Character.PrimaryPart.Position + Vector3.new(plr.Character.PrimaryPart.Velocity.X, plr.Character.PrimaryPart.Velocity.Y, plr.Character.PrimaryPart.Velocity.Z))
					bodyGyro.CFrame = bodyGyroCFrame
				elseif plr.Character.Humanoid.MoveDirection == Vector3.new(0,0,0) and HoldingSpace then
					local bodyGyroCFrame = CFrame.new(plr.Character.PrimaryPart.Position + Vector3.new(0, 5, 0), plr.Character.PrimaryPart.CFrame.LookVector * 400 + plr.Character.PrimaryPart.CFrame.UpVector * 100)
					bodyGyro.CFrame = bodyGyroCFrame
				elseif plr.Character.Humanoid.MoveDirection == Vector3.new(0,0,0) and not HoldingSpace and not hitpart then
					local bodyGyroCFrame = CFrame.new(plr.Character.PrimaryPart.Position, plr.Character.PrimaryPart.Position + Vector3.new(plr.Character.PrimaryPart.Velocity.X, plr.Character.PrimaryPart.Position.Y, plr.Character.PrimaryPart.Velocity.Z))
					--	local bodyGyroCFrame = CFrame.new(plr.Character.PrimaryPart.Position, plr.Character.PrimaryPart.CFrame.LookVector * 1)
					bodyGyro.CFrame = bodyGyroCFrame
				end
			end)
end

I found the solution:
It is working normally without the welded rocks beneath the player, so you have to make sure the welds from the rock beneath the player are handled in the client individually, this way the server would not weld the player like that.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.