Code running from the client won't actually create an object that replicates to every other playing client. That's why there's something called Remote events.
Remove events are a easy way to run code onto the server, however, the replication is not always instant. To make it instant, all you have to do is run it on the client first, then the server, and whitelist every other player. Key information.
But to stay on topic, youtube's code is very simple. All you have to do is copy it and see what it does. The server always prints stuff in a green tag, and the client prints stuff in a blue tag.
Running this code will create the part onto the server
game.ReplicatedStorage.RemoteEvent:FireServer()
print('Fired')
Put this code in a server script.
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Player)
local part = Instance.new("Part")
part.Parent = game.Workspace
print(Player.Name .. " made a part!")
end)
2 comments
Thank you!
Please accept mine or iuclds' answer.