--this line is placed in a module script
game.ReplicatedStorage.Assets.Events.Spawntower.OnServerEvent:Connect(function(p, name, cframe)
module.Spawn(p, name, cframe)
end)
local partexist= game.ReplicatedStorage.Assets.parts:FindFirstChild(name)
if partexist then
local partexist = towerexist:Clone()
partexist.Parent = workspace.Visual
partexist.HumanoidRootPart:SetNetworkOwner()
else
warn("Part does not exist")
end
I suggest changing the location to ServerScriptService. I mean, its a module that can be used to place parts in workspace, you dont want to have it in ReplicatedStorage, you should let client to ask to server if its allowed to place a part, then server should do sanity check to allow or deny, then server should use the Module to place the part, the Module is indeed server sided. Should be on ServerScriptService
Yeah, you were calling that module from client side, thats why only client see the part placed.
You should mandatory, handle the module on server side, so it replicates to all other clients, and in order to do sanity checks, otherwise you are giving the chance to exploiters to use that module to place stuff…
Keep that module in ServerScriptService, now by remotes local script should ask a server script, and server script is the one that requires(module) and do module.Spawn()