-
What do you want to achieve?
I want to delete an object on client for all clients. -
What is the issue?
The issue is that the object is returning nil on the server.
In a local script I am sending the object value to the server:
DestroyObject:FireServer(mtarget,mtarget.Name)
Then receiving it in a server script:
destoryFunction.OnServerEvent:Connect(function(player,object,name)
if object ~= nil then
AllClientsDestroy:FireAllClients(player,object,name)
gold:FireClient(player,name)
local clonedWeapon = game.ReplicatedStorage.Tools[name]:Clone()
clonedWeapon.Parent = player.Backpack
local clonedWeapon2 = game.ReplicatedStorage.Tools[name]:Clone()
clonedWeapon2.Parent = player.StarterGear
end
end)
The problem is that the object is nil on the server but isn’t on the client. Why isn’t the object value being replicated onto the server? Is it because the object value only exists on the client and not on the server? Is there a way around this?