|
| 20 Jul 2013 04:13 AM |
I want the script to spawn balls from mid air so here is what I typed out -
while true do wait() p=Instance.new("Part",Workspace) p.Position=1,1,1 p.Size=10,10,10 p.Shape=Ball end |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 20 Jul 2013 04:15 AM |
while wait() do p=Instance.new("Part",Workspace) p.Position=Vector3.new(1,1,1) p.Size=Vector3.new(10,10,10) p.Shape="Ball" end
There ya go
CLIKC HER 4 A BIG SUPRISE. AER U SUPRISE? |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 04:18 AM |
Ohh I was thinking about using Vector3 Btw how do I use math.random() and make it so that they spawn from random areas? |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 20 Jul 2013 04:20 AM |
Thanks would be nice...
You could do this.... p.Position = Vector3.new(math.random(10), math.random(10), math.random(10))
:)
CLIKC HER 4 A BIG SUPRISE. AER U SUPRISE? |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 04:22 AM |
| Ok but it doesn't seem to be a ball :/ |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 04:24 AM |
| And only one block is created not many |
|
|
| Report Abuse |
|
|
velibor
|
  |
| Joined: 24 Nov 2009 |
| Total Posts: 1003 |
|
|
| 20 Jul 2013 04:24 AM |
function CreateBall() math.randomseed(tick()) Nr = math.random(1,10) Ball = Instance.new("Part") Ball.ShapeFactor = "Ball" Ball.Size = Vector3.new(Nr, Nr, Nr) Ball.BrickColor = BrickColor.new("Bright red") return Ball end
while wait(1) do Ball = CreateBall() Ball.Parent = Game.Workspace Ball.Position = Vector3.new(0,0,0) end
|
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 20 Jul 2013 04:25 AM |
Okay, I think I know. Take off p.Position line and replace with
p.CFrame = CFrame.new(1,1,1)
That should work. Open your output too...
CLIKC HER 4 A BIG SUPRISE. AER U SUPRISE? |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 04:29 AM |
@Velibor it says 14:58:49.154 - ShapeFactor is not a valid member of Part 14:58:49.155 - Script "Workspace.Script", Line 5 - global CreateBall 14:58:49.156 - Script "Workspace.Script", Line 11 14:58:49.156 - stack end |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 04:33 AM |
| @Smiley, it works but the balls won't spawn at random positions :/ |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 20 Jul 2013 04:33 AM |
IamEpic, use mine, not his, even though i can fix his...lol
CLIKC HER 4 A BIG SUPRISE. AER U SUPRISE? |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 20 Jul 2013 04:33 AM |
I know, they shouldn't. Change the CFrame line to this:
p.CFrame = CFrame.new(math.random(10), math.random(10), math.random(10))
CLIKC HER 4 A BIG SUPRISE. AER U SUPRISE? |
|
|
| Report Abuse |
|
|
| |
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 20 Jul 2013 04:40 AM |
Anytime ;)
CLIKC HER 4 A BIG SUPRISE. AER U SUPRISE? |
|
|
| Report Abuse |
|
|
| |
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 20 Jul 2013 05:29 AM |
No, it's Shape.
FormFactor is used to define the shape, eg. Plate.
CLIKC HER 4 A BIG SUPRISE. AER U SUPRISE? |
|
|
| Report Abuse |
|
|
| |
|