How can i make these boxes not replicate their position to the server?

  1. What do you want to achieve? Keep it simple and clear!

Basically. Im making a system where you need to place cardboard boxes to reach the next stage in my obby. Though i noticed that the boxes positions replicate back to the server when i drop them.

As you can guess. This is obviously game breaking. This is meant to only replicate to the local player thats placing the boxes and not to everyone in the server.

I currently have no idea if theres a way to disable weld constraints(Used for attaching the box to the player) from replicating to everyone.

Ive done some research but sadly i only found topic along the lines of “How to make this thing replicate to the server” or “Thing not replicating correctly to server” which doesnt help me the slightest.

I currently have the locla script that handles the inputs inside “StarterPlayerScripts”.
image

Heres the code also:

local function WeldToCharacter(Box: Model)
		local Root = game.Players.LocalPlayer.Character.UpperTorso
		local Weld = Instance.new("WeldConstraint")
		
		Box:PivotTo(Root.CFrame * CFrame.new(0,0,-2))
		Weld.Part0 = Box.PrimaryPart
		Weld.Part1 = Root
		Weld.Parent = Box.PrimaryPart
		Weld.Name = "Grip"
	end


local function HandleCollision(Collision: boolean)
		for _, P in CurrentBox:GetChildren() do
			P.CanCollide = Collision
		end
	end

	local function OnDrop()
		HasBox = false
		Hold:Stop()
		SoundHandler:Play("Cardboard drop")
		
		local Weld = CurrentBox.PrimaryPart.Grip
		
		HandleCollision(true)
		Weld.Part1 = nil
		Weld:Destroy()
		
		Drop:Disconnect()
		Drop = nil
		
		CurrentBox.PrimaryPart.Prompt.Enabled = true
		CurrentBox = nil
		
	end
	
	local function EquipBox(Box: Model)
		Hold:Play()
		HasBox = true
		CurrentBox = Box
		CurrentBox.PrimaryPart.Prompt.Enabled = false
		
		WeldToCharacter(Box)
		HandleCollision(false)
		
		Drop = Plr:GetMouse().Button1Down:Connect(OnDrop)
	end


Primary.Prompt.Triggered:Connect(function()
			if not HasBox then
				EquipBox(Box)
			else
				OnDrop()
				EquipBox(Box)
			end
		end)

Nvm i fixed it by just parenting the boxes to the game once the player has fully loaded so everythings local even the boxes.

1 Like

My game Slither Simulator has to precisely CFrame thousands of spheres every frame. I use a technique of parenting the spheres on each client, to a folder I create under the Workspace.CurrentCamera. This prevents all replication, but it requires the spheres’ CFrames to be independently computed by each client based on sync commands from the server.

1 Like

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