Problems with remote events

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to make a tool called “TestTool” that when activated creates a part in a certain location that every client can see,but not the server.

  2. What is the issue?
    For some reason whenever i use fireallclients to create the part,only the person who activated the tool can see it,but it also doesn’t print any errors.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    tried changing the place the remote event is at (it’s a Remote event called “RemoteEvent” inside ReplicatedStorage),changing the scripts runcontext but nothing seems to work.

this is the tool and the scripts
Captura de tela 2025-04-22 190015
(The tool is at ServerStorage and is parented to the player’s backpack when he steps at a Part in workspace)

-Script

local Tool = script.Parent

Tool.Activated:Connect(function()
local Remote = game:GetService("ReplicatedStorage").RemoteEvent
Remote:FireAllClients()
end)

-Local Script

local Tool = script.Parent
local Player = game.Players.LocalPlayer
local Remote = game:GetService("ReplicatedStorage").RemoteEvent

Remote.OnClientEvent:Connect(function()
	local Part = Instance.new("Part")
	Part.Anchored = true
	Part.CanCollide = false
	Part.Position = Vector3.new(359, 3.5, -96)
	Part.Parent = workspace
	print(Player)
end)
2 Likes

Try moving the local script into somewhere like StarterGui. I suspect the issue is that only players who have the tool have the local script, and hence only they will have the part spawn. By moving the local script to StarterGui, you ensure that every player has the script

The local script wont run because the tool is in Server Storage , If you move the local script valid location

1 Like

If the tool is in Server Storage, it is accessible only to the Server and wont be replicated to clients. Also, you cant put a local script under a tool, your local script needs to be in starterplayerscripts or startercharacterscripts, as both services handle client-side processes. Lasty, put the tool in replicatedstorage to allow for both server and client to access it.

1 Like

Thanks you all for answering.
My tool is not in the ServerStorage anymore (i put it in ReplicatedStorage before its cloned to the player’s backpack).
@SeargentAUS You really are correct,the problem was that not everyone had acess to the local script and parenting it to the startergui did fix the main issue. The problem is that if i parent it to (most) of the valid locations @TheYusufGamer sent or startergui then i dont know if it will be as efficient when i add more tools cause each player will have local scripts for multiple tools,even though only one will have one tool at a time and i also will have problems with organisation so i don’t know if that is really the best solution,do you think there is any other way to keep the current structure of my tools but fix this problem or do i really need to do what you guys are saying?
@azuzsamuelvio111 you also are correct but you may like to read what i wrote above.
I will mark this post as answered when this is done.
(Btw i just tested using a script with runcontext set to client instead of a local script and the results where exactly what i wanted but i dont know if the “runcontext” thing is a real fix or will break in the future).
Again thanks for answering.

1 Like

To anyone that has the same problem,i found out with the help of previous replies that the best way to keep the same structure and achieve exactly what i want is using a script with runcontext set to client instead of a local script,with some minor tweaks (making sure the scripts are disabled until a player gets the tool and creating remote events for each player) it now works perfectly. Thanks for everyone that answered this!