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: So how would i do this? .-.

Previous Thread :: Next Thread 
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
22 Nov 2011 03:03 PM
print("Ant Hill has been loaded")
local Ant = Instance.new("Part",Workspace)
Ant.Size = Vector3.new(2,1.2,1)
Ant.BrickColor = BrickColor.new("Bright red")
Ant.BottomSurface = ("Smooth")
Ant.TopSurface = ("Smooth")
Ant.Position = Vector3.new(0,6.4,0)


Ok, i got that much done, but i need to put a script inside the "Ant". How would i do that? I want it to slowly "Eat" everything it touches.
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:08 PM
Put the script in Lighting, clone it, and parent it to the ant.
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
22 Nov 2011 03:08 PM
Bawmp :3
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
22 Nov 2011 03:08 PM
@City

No..

It's going to be making lots of ants that pretty much invade everything.
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:10 PM
print("Ant Hill has been loaded")
local Ant = Instance.new("Part",Workspace)
Ant.Size = Vector3.new(2,1.2,1)
Ant.BrickColor = BrickColor.new("Bright red")
Ant.BottomSurface = ("Smooth")
Ant.TopSurface = ("Smooth")
Ant.Position = Vector3.new(0,6.4,0)
script = game.Lighting.Scriptname:Clone()
script.Parent = Ant
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
22 Nov 2011 03:12 PM
@City

Now how would i make them go to the nearest Part, and remove it?
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:15 PM
Script it...
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
22 Nov 2011 03:16 PM
@City

..

Duh?
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:18 PM
Find the closest part to it. Use :FindPartsInRegion3(), if there aren't any parts, make it roam around. When it touches part, use the .Touched event, and then use the :Remove() method to remove the part.

Simple
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
22 Nov 2011 03:20 PM
@City

I'm not a good enough scripter to know how to do that without an example...

I'm still confused as to how the lighting works.


1+ Respect if you help me :D
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:21 PM
LOL, lighting is just a folder.

Use the wiki for :FindPartsInRegion3(). It's easy actually.
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
22 Nov 2011 03:22 PM
@City

I know lighting is a folder, but why would i put it there? :o?

Oh, i'v already checked out the wiki about that :3
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:23 PM
Here:

pos = Ant.Position
region = Region3.new(Vector3.new(pos.X + 10, pos.Y + 10, pos.Z + 10), Vector3.new(pos.X - 10, pos.Y - 10, pos.Z - 10))

parts = workspace:FindPartsInRegion3(region)

There.
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:24 PM
jojo, any script in LIghting doesn't execute. So putting it there, and then moving it to workspace allows for easy execution of scripts you want to clone. :D
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
22 Nov 2011 03:27 PM
@City

So, would i move it using a script? Oh just move it by dragging it..
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:28 PM
*facepalm*
You clone it from lighting, and then parent it to anything in workspace.
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
22 Nov 2011 03:31 PM
@City

OH ok :o

Then it creates 2 ants. :D

But the ants don't move..?
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:32 PM
So make them move. Take a zombie script, study it, and then see how it works :D Then use that for the ants.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
22 Nov 2011 03:35 PM
OR

Just use the MoveTo method ....To make it move.
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:37 PM
LOL miz.
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
22 Nov 2011 03:40 PM
I'd use just on script with coroutines and Region3.

http://wiki.roblox.com/index.php/Region3
http://wiki.roblox.com/index.php/Function_Dump/Coroutine_Manipulation

~RATEXmegaGAMER~
-Gamer for life-
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
22 Nov 2011 03:41 PM
Long time no see
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