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

I know you can rotate a part but can you rotate an entire model?

Asked by
Prioxis 673 Moderation Voter
10 years ago

I'm making a city simulator game but the car I'm scripting using the MoveTo method theres a way it has to turn how to make it "Turn" Using rotate? or is it not possible?:

3 answers

Log in to vote
-1
Answered by
MrFlimsy 345 Moderation Voter
10 years ago

There is currently no built-in method of rotating models, but studying scripts such as CmdUtil that allow you to rotate models from Studio might be a step in the right direction.

http://www.roblox.com/CmdUtl-Command-Utility-v3-0-0-item?id=56988233

Ad
Log in to vote
-2
Answered by
KAAK82 16
10 years ago

Hey, sry about not Commenting, I cant Comment for some Stupid Reason -_- This:

w = script.Parent.Parent.Parent.Doors.Door1 
d = script.Parent.Parent.Parent.Doors.Door2 

for r = 1,30 do 
wait() 
for r,p in pairs(w:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,0,-3) end end 
for r,p in pairs(d:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,0,3) end end 
end 

Should be:

w = script.Parent.Parent.Parent.Doors.Door1 
d = script.Parent.Parent.Parent.Doors.Door2 

for r = 1,30 do 
wait() 
for r,p in pairs(w:GetChildren()) do if (p.className == "Part" or className == "Wedge" or className == "Truss" or className == "Seat") then p.CFrame = p.CFrame - Vector3.new(0,0,-3) end end 
for r,p in pairs(d:GetChildren()) do if (p.className == "Part" or className == "Wedge" or className == "Truss" or className == "Seat") then p.CFrame = p.CFrame - Vector3.new(0,0,3) end end 
end 

every time className == has to be repeated (from my experience, and again, sry for not Commenting, my Comments are Disabled for some Stupid Reason...

0
Use :IsA("BasePart") instead. It's much shorter and robust to changes in the future, and includes CornerWedgePart, SpawnLocation, &c. Also, it's "WedgePart" not "Wedge". BlueTaslem 18071 — 10y
0
I know, I just Commented on TheJeterMan's Answer... KAAK82 16 — 10y
Log in to vote
-3
Answered by 10 years ago

You have to define the models and then get the children then Cframe the children like so:

w = script.Parent.Parent.Parent.Doors.Door1 
d = script.Parent.Parent.Parent.Doors.Door2 

for r = 1,30 do 
wait() 
for r,p in pairs(w:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,0,-3) end end 
for r,p in pairs(d:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,0,3) end end 
end 
0
As KAAK82 points out, your conditions are WRONG. You must explicitly state the condition. The condition will always evaluate to true. Furthermore, USE THE METHOD :IsA("BasePart"), DO NOT DO THIS CLASSNAME COMPARISON BlueTaslem 18071 — 10y

Answer this question