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 » Scripting Helpers
Home Search
 

Re: Script not working

Previous Thread :: Next Thread 
7IamEpic32 is not online. 7IamEpic32
Joined: 26 Apr 2012
Total Posts: 547
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 is not online. 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
7IamEpic32 is not online. 7IamEpic32
Joined: 26 Apr 2012
Total Posts: 547
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 is not online. 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
7IamEpic32 is not online. 7IamEpic32
Joined: 26 Apr 2012
Total Posts: 547
20 Jul 2013 04:22 AM
Ok but it doesn't seem to be a ball :/
Report Abuse
7IamEpic32 is not online. 7IamEpic32
Joined: 26 Apr 2012
Total Posts: 547
20 Jul 2013 04:24 AM
And only one block is created not many
Report Abuse
velibor is not online. 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 is not online. 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
7IamEpic32 is not online. 7IamEpic32
Joined: 26 Apr 2012
Total Posts: 547
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
7IamEpic32 is not online. 7IamEpic32
Joined: 26 Apr 2012
Total Posts: 547
20 Jul 2013 04:33 AM
@Smiley, it works but the balls won't spawn at random positions :/
Report Abuse
smiley599 is not online. 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 is not online. 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
7IamEpic32 is not online. 7IamEpic32
Joined: 26 Apr 2012
Total Posts: 547
20 Jul 2013 04:36 AM
Yay it works thanks! :D
Report Abuse
smiley599 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
20 Jul 2013 05:25 AM
It's FormFactor.
Report Abuse
smiley599 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
20 Jul 2013 05:30 AM
Ah, right.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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