Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a models parts change?

Asked by 2 years 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 247 Moderation Voter
2 years 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 — 2y
0
i dont get whats wrong then. Sorry Xyternal 247 — 2y
Ad

Answer this question