Hello I tried to make a script that fire other clients except the people who sent data to server
but it fires all client not others and it don’t fire back to client only one player but it fires all client
with part in workspace is fires all client
with part in player character is fires other client
ignore discord notification sound
Server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MyRemoteEvent = ReplicatedStorage:WaitForChild("MyRemoteEvent")
MyRemoteEvent.OnServerEvent:Connect(function(player, part, pos, rot)
for _, otherPlayer in ipairs(game.Players:GetPlayers()) do
if otherPlayer ~= player then
MyRemoteEvent:FireClient(otherPlayer, part, pos, rot)
end
end
end)
local MRE = game.ReplicatedStorage:WaitForChild("MyRemoteEvent")
Client Receive:
MRE.OnClientEvent:Connect(function(part,pos,rot)
print("received")
part.Position = pos
part.Orientation = rot
end)
Client Send:
local MRE = game.ReplicatedStorage:WaitForChild("MyRemoteEvent")
workspace.DescendantAdded:Connect(function(instance)
if instance:IsA("BasePart") then
instance.Changed:Connect(function(prop)
if prop == "Position" and "Orientation" then
MRE:FireServer(instance, instance.Position,instance.Orientation)
end
end)
end
end)
I tried to solve the problem with this script but it doesn’t work actually
local MRE = game.ReplicatedStorage:WaitForChild("MyRemoteEvent")
local player = game.Players.LocalPlayer
MRE.OnClientEvent:Connect(function(plr, part,pos,rot)
if plr ~= player then
print("received")
part.Position = pos
part.Orientation = rot
end
end)