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: Will this work? [Easy]

Previous Thread :: Next Thread 
xXStealthsniper200Xx is not online. xXStealthsniper200Xx
Joined: 30 Nov 2011
Total Posts: 2037
05 Jan 2012 03:40 PM
game.Lighting.Enemy:Clone().Parent = game.Workspace
end

-----------------------------------------------------------------------------------------------
Just making sure I got this right, I don't wanna spend time making a broken script.

Also, is it (random.math) 1, 2), random.math(1, 2)?
I'm trying to think of how to make a chance script... and I forgot how to write it.

If you could get me a link about it, that would really help a lot.

:)
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
05 Jan 2012 03:41 PM
game.Lighting.Enemy:Clone().Parent = game.Workspace

Should be fine, just make sure Enemy exists.

Also, it's math.random(1,2)
Report Abuse
xXStealthsniper200Xx is not online. xXStealthsniper200Xx
Joined: 30 Nov 2011
Total Posts: 2037
05 Jan 2012 03:45 PM
Oh ok, thanks. Still the only thing I need to know now is, how do I make like find what random number it is. That's why I could of used a link to the wiki because it would maybe explain.

Like if the random number is 1 then, or if 2 then.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
05 Jan 2012 03:47 PM
local t = math.random(3)

if t == 1 then
elseif t == 2 then
elseif t == 3 then
end


Also, if you :Clone() an object and parent it to Workspace, and it has unanchored bricks, then you should, immediately after, use :MakeJoints().
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
05 Jan 2012 03:48 PM
RandomNumber=math.random(1,2)
if RandomNumber==1 then
--1 stuff
elseif RandomNumber==2 then
--2 stuff
else
print("RandomNumber is NaN")
end
Report Abuse
xXStealthsniper200Xx is not online. xXStealthsniper200Xx
Joined: 30 Nov 2011
Total Posts: 2037
05 Jan 2012 03:49 PM
Good to know, thanks. I didn't know that.
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