On the server, all models are periodically removed (Destroy) in a folder (in workspace) and new ones are placed. On the client, these new models must be taken and some properties of certain parts within the models must be changed (only on the client’s side). When a player joins the loop is executed and the properties change correctly, but later, when a model is obtained through the ChildAdded event the properties do not change.
Here are the scripts, there is no other script in the game:
-- Script
local model1 = workspace.Models.Model
model1.Parent = nil
function cleanModels()
for _, model in ipairs(workspace.Models:GetChildren()) do
model:Destroy()
end
end
local clone
while true do
wait(10)
cleanModels()
clone = model1:Clone()
clone.Parent = workspace.Models
end
-- LocalScript
local models = workspace:WaitForChild("Models")
function onChildAdded(model)
for _, part in ipairs(model:GetChildren()) do
if part:IsA("BasePart") then
part.RotVelocity = Vector3.new(0,3,0)
part.BrickColor = BrickColor.new("Brown")
end
end
end
wait(15)
models.ChildAdded:Connect(onChildAdded)
for _, model in ipairs(models:GetChildren()) do
onChildAdded(model)
end
I don’t understand why this happens. Could someone help me?
Edit: Here’s the place
Baseplate.rbxl (19.1 KB)
Here’s a snapshot