Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Players can still see each others destroyed parts?

I'm making a mining game, and I made a pickaxe tool for this. But when one player mines a part, other people can still see this part. This is the script in the pickaxe, any idea how to fix it? It's in a local script by the way.

local Players = game:GetService("Players")
local localPlayer = script.Parent.Parent.Parent
local backpack = localPlayer:WaitForChild("Backpack")
local tool = script.Parent
local clicks = 0 


tool.Equipped:Connect(function(mouse)
	mouse.Button1Down:Connect(function()
		clicks = clicks + 1
		if mouse.Target.Parent then
			if (mouse.Target.Position - localPlayer.Character.HumanoidRootPart.Position).Magnitude < 15 then
				if mouse.Target.Name == "GrassBlock"then
					mouse.Target:Destroy()
				elseif mouse.Target.Name == "StoneBlock"then
					if clicks > 2 then
						mouse.Target:Destroy()
						clicks = 0
					end
				end
			end
		end
	end)
end)

2 comments

0

you need to send the destory to the server try remote functions https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events

0

if you change the workspace using a local script it only changes for that one client, not the server

1 answer

✓ Accepted answer

Hello there!

Due to Filtering Enabled, anything the happens on the client, (from printing to clearing all the children of workspace) will not happen/replicate to the server (rest of the players).

There is an easy fix for this. You can use Remote Events or Functions.

2 comments

0

im pretty sure printing from a local script never showed to other clients anyway...

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.