generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Any way to rotate my model?

Previous Thread :: Next Thread 
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
14 May 2015 02:35 PM
I was wondering if I could rotate the waves to match the rotation of its spawner. Here is my script:

local Wave = game.ReplicatedStorage.Waves.SmallWave
local BigWave = game.ReplicatedStorage.Waves.LargeWave
local Waves = {Wave, BigWave}
local Model = game.Workspace.WaveSpawners:GetChildren()

while true do
wait()
local WaveChoose = Waves[math.random(1,#Waves)]
local Pos = Model[math.random(1, #Model)]
print (Pos)
local Chosen = WaveChoose:Clone()
Chosen.Parent = game.Workspace
Chosen:MoveTo(Pos.Position+Vector3.new(0,1,0))
wait(math.random(3, 15))
end
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
14 May 2015 02:37 PM
to rotate a model use model:SetPrimaryPartCFrame

http://wiki.roblox.com/index.php?title=API:Class/Model/SetPrimaryPartCFrame
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
14 May 2015 02:38 PM
Thanks, so what would I do? Would this work

Model:SetPrimaryPartCFrame(part.Rotation)

?
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
14 May 2015 02:40 PM
nope. you need to use a CFrame

Report Abuse
Stefan631 is not online. Stefan631
Joined: 23 Dec 2010
Total Posts: 1350
14 May 2015 02:41 PM
http://www.roblox.com/TransformModel-item?id=54069010
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
14 May 2015 02:42 PM
@Stefan
Thanks but I don't want to use a free model.
@builder
Could you give me an example?
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
14 May 2015 02:42 PM
model:SetPrimaryPartCFrame(spawner.CFrame - spawner.position + model:GetPrimaryPartCFrame().p)

That should work. (I think)

Make sure the model has a primary part tho!
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
14 May 2015 02:43 PM
I know I'm asking for a lot, but how do I set a model's primary part?
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
14 May 2015 02:45 PM
model.PrimaryPart = model.PartName
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
14 May 2015 02:53 PM
Thanks, but for some reason it did not work? Help please:

local Wave = game.ReplicatedStorage.Waves.SmallWave
local BigWave = game.ReplicatedStorage.Waves.LargeWave
local Waves = {Wave, BigWave}
local Model = game.Workspace.WaveSpawners:GetChildren()

while true do
wait()
local WaveChoose = Waves[math.random(1,#Waves)]
local Pos = Model[math.random(1, #Model)]
print (Pos)
local Chosen = WaveChoose:Clone()
Chosen.PrimaryPart = Chosen.Hold
Chosen:SetPrimaryPartCFrame(Pos.CFrame - Pos.position + Chosen:GetPrimaryPartCFrame().p)
Chosen.Parent = game.Workspace
Chosen:MoveTo(Pos.Position+Vector3.new(0,1,0))
wait(math.random(3, 15))
end
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
14 May 2015 03:01 PM
Nevermind! Also, is my character an X to anyone else?
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
14 May 2015 03:03 PM
I think Roblox's image server thingies are breaking down
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
14 May 2015 03:09 PM
an X?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image