quebrado
(quebrado)
1
Hey! Title says it all…
script is in ServerScriptService:
local RE = game.ReplicatedStorage.Remotes.CloneObject
RE.OnServerEvent:Connect(function(object, destiny)
object:Clone().Parent = destiny
end)
Here’s how I’m firing the event, trhought a localscript on the PlayerGui:
game.ReplicatedStorage.Remotes.CloneObject:FireServer(game.ReplicatedStorage.obj01, game.Workspace)
Iemny
(Iemny)
2
When you clone an object and wish to edit it’s properties, its suggested to create a new variable for said clone;
RE.OnServerEvent:Connect(function(object, destiny)
local clonedObject = object:Clone()
clonedObject.Parent = destiny
end)
The player is always OnServerEvent (NOT OnClientEvent)'s first argument so you need to do this instead:
RE.OnServerEvent:Connect(function(player, object, destiny)
object:Clone().Parent = destiny
end)