|
| 09 Jul 2011 03:43 PM |
I made a Script that worked perfectly fine and I then tried to make it so the model appeared infront of the Player. It now doesn't work at all, yet the Output says it should work. There are no errors in the output at all... Here it is:
a = math.pi b = math.pi
local mod = Instance.new("Model") mod.Name = "hurricane" mod.Parent = game.Workspace
function createPart() local p = Instance.new("Part") p.Anchored = true
-------------------------------------------------------------
amountInFront = 15 torsoNormal = humanoid.Parent.Torso.CFrame.lookVector denom = math.abs(torsoNormal.x) + math.abs(torsoNormal.z) posX = amountInFront * (torsoNormal.x/denom) posZ = amountInFront * (torsoNormal.z/denom) pos = Vector3.new(pos.x + posX,pos.y, pos.z + posZ) p.Position = pos
-----------------------------------------------------------------
p.CFrame = CFrame.fromEulerAnglesXYZ(0,a,0) * CFrame.new(b,a,b) a = a+00.1 b = b+0.035 p.Parent = mod local m = Instance.new("BlockMesh") m.Parent = p end
function start() for i = 1,1000 do createPart() wait() end end
function onChatted(msg, speaker) if msg:lower() == "hurricane" then do start() wait() end end end
game.Players.PlayerAdded:connect(function(p) if p:IsInGroup(106362) then p.Chatted:connect(function(msg) onChatted(msg, newPlayer) end) end end)
The section in ------------- is the place where it positions. I think it might be due to the fact that the PArt is Instance not Workspace. Can anyone help? |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:47 PM |
mod:MoveTo(PART_YOU_WANT_INFRONT_OF.CFrame+CFrame.new(5,0,0))
Try messing with that. |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:50 PM |
| So could I make that script ^ to be 15 studs infront of Player torso or something? |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 03:55 PM |
| Yes sir, http://news.roblox.com/index.php/MoveTo |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 04:08 PM |
Ah okay, so something like
mod:MoveTo(player.Torso.Position.CFrame+CFrame.new(5,0,0))
? |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 04:12 PM |
Actually would
mod:MoveTo(Vector3.new(10,0,0))
be better? |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 04:13 PM |
| It can't be player but it has to be the character of the player. |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 04:25 PM |
| @Vic, that would move the model to 10,0,0, not infront of your character. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 12:42 PM |
I know that now. I wasn't thinking straight last night... There is one problem with this though... The script I desire to use it on Places the Bricks in Instance and the Model in Workspace. What can I do to make it move? |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 05:06 PM |
Part.Parent = Model
Change around "Part" to be the part you want to put in "Model" |
|
|
| Report Abuse |
|
|