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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 14 May 2015 02:40 PM |
nope. you need to use a CFrame
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 14 May 2015 02:45 PM |
| model.PrimaryPart = model.PartName |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|