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!
Local models to each player.
What is the issue? Include screenshots / videos if possible!
The script I am using does not make the models local for some reason.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I made a topic and followed a script based on what the people said. It still didn’t work.
Local script inside starter player scripts:
local pushplat = workspace.Tower1.PushPlatforms:GetChildren() --Gets models of the folder inside of the workspace tower 1
for _, push in pairs(pushplat) do --loops through models
push.Parent = game.ReplicatedStorage --makes its new parent the ReplicatedStorage
local pushclone = push:Clone() --clones the models
pushclone.Parent = workspace.Tower1.PushPlatforms --puts it back into the folder inside the workspace tower1
end
Okay so I have added print statements to the code and it prints everything, but it is still not local.
Code:
local pushplat = workspace.Tower1.PushPlatforms:GetChildren()
for _, push in pairs(pushplat) do
print("pushplat: ".. push.Name)
push.Parent = game.ReplicatedStorage
print("Parented to replicated storage")
local pushclone = push:Clone()
print("Cloned")
pushclone.Parent = workspace.Tower1.PushPlatforms
print("New parent is the folder")
end
This is local, you are just running it for every player in the server. the way you are doing it, it runs for everyone because you never run it for a single player.
I just want it so that each player has their own version so that people can still use the model without someone else being able to use it. Does this make sense?
Adding on to what @JasonSpero said, make the model start located directly inside of ReplicatedStorage. The reason it still shows on the server is because you moved it from the client, so it only moves it, you guessed it, for the client.
To fix this, move the PushPlatforms model to ReplicatedStorage and replace your code with
for _, push in pairs(game.ReplicatedStorage:WaitForChild("PushPlatforms"):GetChildren()) do --loops through models
local pushclone = push:Clone() --clones the models
pushclone.Parent = workspace.Tower1.PushPlatforms --puts it back into the folder inside the workspace tower1
end
Hmm so I did something like this and it still isn’t local. I stored the folder of the models inside replicated storage.
Script:
local folderpush = workspace.Tower1.PushPlatforms
local reppush = game.ReplicatedStorage.PushPlatforms:GetChildren()
for _, push in pairs(reppush) do
local clone = push:Clone()
clone.Parent = folderpush
end
anything local will only be played on 1 client unless if you put it in startercharacterscripts and starterplayerscripts if you want to call it by function then send a bindable event to do all this work for u of cloning all the parts and model everything that is not local is from the server