I've tried this:
local rs = game.ReplicatedStorage
rs.SpawnPlane.OnServerEvent:Connect(function(plane)
local existingPlane = game.Workspace:FindFirstChild(plane.Name)
if existingPlane then
existingPlane:Destroy()
end
local clonedPlane = plane:Clone()
clonedPlane.Parent = workspace
print("Spawned: " .. plane.Name .. "!")
end)
but it gives me this error:
10:20:01.263 ServerScriptService.SpawnPlane:10: attempt to index nil with 'Parent' - Server - SpawnPlane:10
please help im confused

2 comments
First of all, Function1; Your variable [plane is nil]
No, its defined as the object in ReplicatedStorage; the function is called from a LocalScript in a text button(which spawns the plane); inside the localscript, plane is defined as the model in ReplicatedStorage, and then i send signal to the RemoteEvent called SpawnPlane; along with the arguements of (plane).