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: Help with Random..

Previous Thread :: Next Thread 
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
20 Oct 2012 07:36 PM
How would i go about making a block that when i click, it gives me a random gear from lighting. Also, is there a way to set the chance of getting a gear? Thanks.
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
20 Oct 2012 07:48 PM
Use the way a dance floor color works to make it pick something random :D
Use the colors to change the chance.
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
25 Oct 2012 12:08 AM
bump
Report Abuse
TaaRt is not online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
25 Oct 2012 04:48 AM
You are requesting a script, this forum isn't meant to do so.
Report Abuse
TaaRt is not online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
25 Oct 2012 04:49 AM
To increase chance however, you could simply but multiple of the same gear in Lighting, easiest way there is.
Report Abuse
TaaRt is not online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
25 Oct 2012 04:50 AM
*put
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
25 Oct 2012 05:49 AM
gears = {"GEARNAME";"GEARNAME";"GEARNAME"} -- Add more if you want.


script.Parent.ClickDetector.MouseClick:connect(function(plr)
g = game.Players:findFirstChild(plr.Name)
if g then
f = gears[math.random(1, #gears)
n = game.Lighting:findFirstChild(f)
if n then
n:Clone.Parent = plr.Backpack
end
end
end)


Havent tested, just try it.

~A3~
Report Abuse
SourceLeak is not online. SourceLeak
Joined: 10 Jun 2012
Total Posts: 841
25 Oct 2012 05:53 AM
script.Parent.MouseClick:connect(function(p)
gearc = game.Lighting.Gear:GetChildren()
gear = gearc[math.random(1, #gearc)]
gear:clone().Parent = p.Backpack
end)

Just put all the gear in a model called "Gear" in the Lighting.
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
25 Oct 2012 06:17 AM
Thanks SourceLift! I just had to edit 2 things to make it worse though. Thanks.
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
25 Oct 2012 06:19 AM
my brain isnt working. Thanks SOURCELEAK.. imma fail
Report Abuse
FurryLegoDude is not online. FurryLegoDude
Joined: 04 Oct 2012
Total Posts: 576
25 Oct 2012 06:40 AM
You mean like a Random gear giver?
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