Client only objects being controlled by other clients... why?

I would like there to be a pushable wall, only pushable by the client who sees it.

Although I’ve got a local script, cloning the wall from replicated storage, all clients can push and move the wall.
The wall isn’t known to the server. and the script that allows for the pushing is also a local script.

I’m not sure what to do. My understanding is that objects replicated on the client side, only appear to the client that replicated it…

I had a video here… but I’ll have to reupload it… frame rate was to choppy.

I thought I’d done this correctly, but apparently not. any geniuses know whats up?

Thanks for reading.

1 Like

I actually thought Roblox had gotten rid of the FilteringEnabled option, and made it turned on without the ability to change it. Turns out, the option is still available on Workspace.

I would think the issue here is that FilteringEnabled is not turned on in your game, if you switch it on you should see immediate changes.

Hope this helps!

Filtering enabled is no longer possible.

I would like to see a video of what you mean. Please show the scripts and properties as well. @XlxLiveLivelyxlX

2 Likes

it is in fact, on. But thank you for your help, regardless :slight_smile:

1 Like

hold tight. Im uploading one now :slight_smile:

Give it a sec.

Come to think about it, I do remember hearing about this.

Thanks for posting that, now I know. :slight_smile:

Also, I know the video is choppy. My computer picks the worst of times to get laggy.

Now as far as code goes:
– Local script in starter character
function LoadStage()
local propFolder = repStorage:FindFirstChild(“Stage”…stage);
local playerScripts = propFolder.Player:Clone();
playerScripts.Parent = char;

	local clientProps = propFolder.ClientProps:Clone();
	clientProps.Parent = stageFolder;
end
LoadStage();

and then in the above code, a player folder is placed into the char, which contains a script that controls this:

movePart1.Touch.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		if movePart1.Position.X > goal then
	
			movePart1.PrismaticConstraint.Speed = 3.5;

			if movePart1.Sound.IsPlaying == false then
				movePart1.Sound:Play();
			end
			if pushAnimation.IsPlaying == false then
				pushAnimation:Play();
			end
		end
	end
end)

and thats pretty much it. Its using a prismatic constraint to move it. and the prismatic constraint speed is set to 0 like so:

game:GetService("RunService").RenderStepped:Connect(function(dt)
	-- monitor the push animatoin		
	if pushAnimation.IsPlaying == true and (humanoid.MoveDirection.Magnitude == 0 or (myRoot.Position - movePart1.Touch.Position).magnitude > 3.5)then
		pushAnimation:Stop();		
		movePart1.Sound:Stop();	
		movePart1.PrismaticConstraint.Speed = 0;
	end
end

everything is done through a local script btw.

Okay, so, just tested this with a friend. If your constraint is created on the server and connected to a locally created part, then the locally created part’s physics will replicate.

My place: test - Roblox

EDIT: Only the physics will replicate for all players, visuals will still be client only.

2 Likes

the attachment is attached to a server part. Interesting… I’ll try that real quick.

Right here you are checking if any humanoid touches the block. That will cause all players touching it to move it on all local scripts (all players see it). Since this is in a local script, and you only want the player who is on the particular client to be able to see the movement, then you need to make sure that the Humanoid is the Player’s humanoid.

local hum, chr = hit.Parent:FindFirstChild("Humanoid"), game.Players.LocalPlayer.Character
if hum and chr and hum.Parent == chr then

Edit: Updated code for sanity checks so that it can’t error if the character or humanoid is nil.

Hmm. I was planning on making my hedges client only; and placed that whole folder into my client objects to be replicated, and it still persists…

Yeah, we just tried client created everything, and the physics were also replicated. Weirdddd.

I tried your idea, and unfortunatly, it did not solve the issue.

Why would it even show that its moving? they are only seen by that client, so every other client wouldnt know it exists…

Please show me what you did (your code). I think you are misunderstanding my answer.

If every client updates the position of the block when ANY HUMANOID in the game touches it, then it is recreating the same effect on EVERY CLIENT.

It is not replicating, it’s just happening for any player touching it on every device.

movePart1.Touch.Touched:Connect(function(hit)
	local hum = hit.Parent:FindFirstChild("Humanoid")
	if hum == game.Players.LocalPlayer.Character.Humanoid  then
		if movePart1.Position.X > goal then
	
			movePart1.PrismaticConstraint.Speed = 3.5;

			if movePart1.Sound.IsPlaying == false then
				movePart1.Sound:Play();
			end
			if pushAnimation.IsPlaying == false then
				pushAnimation:Play();
			end
		end
	end
end)

it shouldnt error out, since the hit.Parent should only ever be the client.

Can you send me a place file or create another video with that sanity check included?

That definitely should have solved the problem from what I can see.

ill include the sanity checks. one sec.

so even with the sanity checks its still doing it…

movePart1.Touch.Touched:Connect(function(hit)
	local hum, chr = hit.Parent:FindFirstChild("Humanoid"), game.Players.LocalPlayer.Character
	if hum and chr and hum.Parent == chr then
		if movePart1.Position.X > goal then
	
			movePart1.PrismaticConstraint.Speed = 3.5;

			if movePart1.Sound.IsPlaying == false then
				movePart1.Sound:Play();
			end
			if pushAnimation.IsPlaying == false then
				pushAnimation:Play();
			end
		end
	end
end)

This is so strange.

The movepart, and the hedges are all client objects. Which means they are unique per say to each client.
they are created with a local script. the code that controls it is also a client script.

Wouldn’t it make sense that something that is created on my machine would not be visible on your machine, for example?

So you shouldn’t be able to control it.

Maybe its cause the control script is in the players character?

Can you show me? I don’t see how the other players would be seeing this movement at this point, unless I’m misunderstanding your intentions.

Edit: If you use gyazo it only takes seconds to post a GIF of the behavior. I think you can also upload the video directly to your post without having to upload it to YouTube first.

i downloaded gyazo the other day when I asked about moving the wall.

Give me a sec to install it.