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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Help needed with a script that spawns a part at a location

Previous Thread :: Next Thread 
593675059853 is not online. 593675059853
Joined: 15 Dec 2013
Total Posts: 5
17 Jul 2014 12:59 AM
I need some help with a script that spawns a part at a location 10 times with a 5 second interval before each spawning. I have gotten the script to "know" what the part I am requesting to spawn is like and it's location, but I have yet to actually have the script successfully spawn it. I have studied some tools' scripts like the Time Bomb and the Rocket Launcher to see how they create the new object in the workplace, but they all use the player's location and the target of the mouse, while I need to use a static location. Basically, I need help with getting the script to make the part. Bear in mind I have 3 days of scripting experience.

Here is the script I have made so far:

-----beginning of script-----
function spawn()
local part = Instance.new ("Part")
part.BackSurface = 0
part.BottomSurface = 0
part.FrontSurface = 0
part.LeftSurface = 0
part.RightSurface = 0
part.TopSurface = 0
part.BrickColor = BrickColor.new(17)
part.FormFactor = 1
part.Size = Vector3.new (4, 1.2, 2)
part.Position = Vector3.new (0, 8, 0)
part.Name = "SpawnedPart"
part.Anchored = false
end

for spawncounter = 1, 10 do
wait (5)
spawn()
end
-----end of script-----
Report Abuse
WishNite is not online. WishNite
Joined: 11 Feb 2009
Total Posts: 15828
17 Jul 2014 01:02 AM
you didn't set the Parent of the part?
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
17 Jul 2014 01:03 AM
change this

local part = Instance.new ("Part")

to this


local part = Instance.new ("Part", game.Workspace)
Report Abuse
Fidgeting is not online. Fidgeting
Joined: 08 Feb 2014
Total Posts: 1193
17 Jul 2014 01:05 AM
local part = Instance.new ("Part", game.Workspace)


you forgot to add game.Workspace.

the part didn't have a place to spawn in.
Report Abuse
593675059853 is not online. 593675059853
Joined: 15 Dec 2013
Total Posts: 5
17 Jul 2014 02:10 PM
*facepalm*
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