Ad
Log in to vote
0

How can I make a models parts change?

Asked by 3 months ago

How can I make every part in a model move, rotate and change the transparency level?

Here's what I tried:

local prompt = script.Parent

prompt.Triggered:Connect(function(player) print("hi you triggered me i guess") for i,v in pairs(workspace.Everything.OrganizedThings.Useables.OpenandShut.Vault.Door:GetChildren()) do v.Transparency = 1 for i,v in pairs(workspace.Everything.OrganizedThings.Useables.OpenandShut.Vault.Door2:GetChildren()) do v.Transparency = 0 end)

Thanks :)

  • Mastically

1 answer

Log in to vote
0
Answered by
Xyternal 192
3 months ago

Soo you have to first loop through the models childs and decedents just like how im going to show you in my script. Sadly, idk how to rotate parts

local model = game.Workspace.Model

for i, v in pairs(model:GetDecendents()) do
--if you want to move then do this code
if v IsA("Part") then
v.Position = Vector3.new(x,y,z)

--this code for transparency
v.Trasparency = youramount


end




end
0
It says GetDecendents is not a valid member of Model "Workspace.Everything.OrganizedThings.Useables.OpenandShut.Vault.Door2 Mastically 0 — 3mo
0
i dont get whats wrong then. Sorry Xyternal 192 — 3mo
Ad

Answer this question