You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Models stored inside a model to be client sided so players can use their own model.
What is the issue? Include screenshots / videos if possible!
Everything seems to work but players can still use the same models.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I made a topic on this problem, a few actually, but the solutions I got didn’t work and I didn’t understand them.
Local script inside starter player scripts:
local push = game.ReplicatedStorage:WaitForChild("PushPlatforms")
local pushclone = push:Clone()
print("Cloned model folder")
pushclone.Parent = workspace:WaitForChild("Tower of Troubling Tutorials")
print("Success! Placed folder inside the Tower of Troubling Tutorials inside the workspace!")
By using models, I mean the pushing platforms. These platforms are pushable so that players can push them. They have constraints and other things in them but no scripts. I stored them inside a model inside a folder inside replicated storage, so that I can clone them and put them inside the workspace where I want them to be. Everything in this current script prints, and I can see the models perfectly, but the issue is that multiple players can use the same model.
How can this be if your movable model only exists on the client? If it only is on individual clients, and not the server, it shouldn’t be able to replicate in this instance since it’s not even available to anyone else, as far as I know.
Can we get a video of you double client( with two clients and two windows )testing this, so we can see it for ourselves? Being able to see it happen would be helpful in figuring out the issue.
Also, if the models spawn in at different times, are you saying that all of the models teleport to the Position of the first one? I can’t quite picture this.
Hmm, maybe it’s a network ownership kind of thing? Might be because of the physics based movement you are using. I believe roblox tries to automatically replicate physics on a basepart to a server especially with constraints.
Also see here, definitely the constraints, physics on client is automatically updated for server.
While part properties do not technically replicate, there are a few exceptions. If the part is created by a client and that client simulates physics (the part falls, hits other objects, moves by constraints, etc.), the resulting changes will get copied to the server.
How can I achieve this? I created a remote event to make the models local but it still doesn’t. I made a server script inside the server script service saying this:
local remotevar = game.ReplicatedStorage.LocalModelOrPart
game.Players.PlayerAdded:Connect(function(player)
remotevar:FireClient(player)
end)
And then in a local script inside the starter player scripts I did this:
local remotevar = game.ReplicatedStorage.LocalModelOrPart
remotevar.OnClientEvent:Connect(function()
local push = game.ReplicatedStorage:WaitForChild("PushPlatforms")
local pushclone = push:Clone()
print("Cloned model folder")
pushclone.Parent = workspace:WaitForChild("Tower of Troubling Tutorials")
print("Success! Placed folder inside the Tower of Troubling Tutorials inside the workspace!")
end)
It seems to clone and parent fine, but it still has the same issue. You recommend me into changing the root part of the moving platform model? And if I do, would I keep the same code?
local remotevar = game.ReplicatedStorage.LocalModelOrPart
remotevar.OnClientEvent:Connect(function()
local push = game.ReplicatedStorage:WaitForChild("PushPlatforms")
local pushclone = push:Clone()
print("Cloned model folder")
for i, v in pairs(push:GetChildren()) do
if v:IsA("BasePart") then
v:SetNetworkOwner()
end
end
pushclone.Parent = workspace:WaitForChild("Tower of Troubling Tutorials")
print("Success! Placed folder inside the Tower of Troubling Tutorials inside the workspace!")
end)
local remotevar = game.ReplicatedStorage.LocalModelOrPart
local player = game.Players.LocalPlayer
remotevar.OnClientEvent:Connect(function()
local push = game.ReplicatedStorage:WaitForChild("PushPlatforms")
local pushclone = push:Clone()
print("Cloned model folder")
pushclone:SetNetworkOwner(player)
pushclone.Parent = workspace:WaitForChild("Tower of Troubling Tutorials")
print("Success! Placed folder inside the Tower of Troubling Tutorials inside the workspace!")
end)
So I did some testing and I came up with this script.
local remotevar = game.ReplicatedStorage.LocalModelOrPart
local player = game.Players.LocalPlayer
remotevar.OnClientEvent:Connect(function()
local push = game.ReplicatedStorage:WaitForChild("PushPlatforms")
local pushclone = push:Clone()
print("Cloned model folder")
local models = pushclone:GetChildren()
for _, model in pairs(models) do
local baseparts = model:GetChildren()
for _, basepart in pairs(baseparts) do
if basepart:IsA("BasePart") then
print("Is base part")
basepart:SetNetworkOwner(player)
print("Set network owner to "..player.Name)
end
end
end
pushclone.Parent = workspace:WaitForChild("Tower of Troubling Tutorials")
print("Success! Placed folder inside the Tower of Troubling Tutorials inside the workspace!")
end)
local remotevar = game.ReplicatedStorage.LocalModelOrPart
local player = game.Players.LocalPlayer
remotevar.OnClientEvent:Connect(function()
local push = game.ReplicatedStorage:WaitForChild("PushPlatforms")
local pushclone = push:Clone()
print("Cloned model folder")
local models = pushclone:GetChildren()
for _, model in pairs(models) do
local baseparts = model:GetChildren()
for _, basepart in pairs(baseparts) do
if basepart:IsA("BasePart") then
print("Is base part")
basepart.Parent = workspace
basepart:SetNetworkOwner(player)
print("Set network owner to "..player.Name)
basepart.Parent = workspace:WaitForChild("Tower of Troubling Tutorials")
end
end
end
pushclone.Parent = workspace:WaitForChild("Tower of Troubling Tutorials")
print("Success! Placed folder inside the Tower of Troubling Tutorials inside the workspace!")
end)