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: How do I....

Previous Thread :: Next Thread 
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 09:58 PM
Well it's hard to put this in a question but, how do I make like a item drop rarity,
like for examp;e, 25% item drop (within the 25% is either like a 50% chance of getting a potion or a 50% chance of getting a sword or something)
Thank you if you can help.
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 09:59 PM
example*
and this script goes under the monster's humanoid this happens when it hits 0 (of course)
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
17 Oct 2013 10:02 PM
honestly I use math.random for this
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 10:11 PM
I don't know how to do that and
I'm learning how to script when I get the chance, but thanks anyways
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 10:27 PM
bump
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
17 Oct 2013 10:27 PM
Since % is out of 100, divide it by chance of getting this item. So let's say you want 25%, you would divide 25 by 25 and divide 100 by 25, you would get 1/4. This is the range you're going to get chance = math.random(1, 4). Hoping this makes sense.
Report Abuse
chickenman158 is not online. chickenman158
Joined: 18 Jan 2011
Total Posts: 915
17 Oct 2013 10:28 PM
mythicrare = 0.001 --bronze drops
rare = 0.01 -- gold drops
uncommon = 0.1 -- silver drops
common = 1 -- black drops

MTG.Cards:GetMythics()["Wurmcoil Engine"].Chance = math.random(1,6) * mythicrare

Example for MTG.
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 10:46 PM
thanks, but i'm a NOOB at scripting so
do I just put all this into a script like that or no? xD
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
17 Oct 2013 10:48 PM
>Comes to Scripting Helpers
>Asks for help
>Doesn`t try to learn
You know nothing and should attempt to learn before you ask for help.
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 10:50 PM
you're the one to judge and say I noot trying to learn,
If you read my previous comments before I said, I will when I have the time, ok.
Report Abuse
XAXA is not online. XAXA
Joined: 10 Aug 2008
Total Posts: 6315
17 Oct 2013 10:51 PM
function dropItem()
if math.random(1,100) < 25 then -- 25% chance of an item actually dropping
print[[Dropped something!]]
if math.random(1,100) <= 50 then -- if the random number generated is from 1 to 50 out of 100, which is a 50% probability
--drops sword
print[[Dropped a sword]]
else
--drops potion
print[[Dropped a potion]]
end
end
end
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 10:53 PM
Thanks
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
17 Oct 2013 10:56 PM
The thing is:
You`re not supposed to ask for help unless you`ve actually tried it.
Who knows, You might be a natural.
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 10:58 PM
i think the script needs something else to it..
Report Abuse
XAXA is not online. XAXA
Joined: 10 Aug 2008
Total Posts: 6315
17 Oct 2013 11:00 PM
I already gave you a basic script that does something out of chance. See the
--drops sword
and
--drops potion
comments? Fill those in with the appropriate code. You can try cloning something out of storage and place it on top of the killed monster.
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 11:12 PM
Like with the lighting clone part
Report Abuse
XAXA is not online. XAXA
Joined: 10 Aug 2008
Total Posts: 6315
17 Oct 2013 11:14 PM
Use replicatedstorage

http://wiki.roblox.com/index.php/RBX.lua.ReplicatedStorage_(Object)
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
17 Oct 2013 11:18 PM
Ok and I'm going to sleep I try that tomorrow and thanks you are a big help
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
18 Oct 2013 09:49 AM
?
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
18 Oct 2013 09:50 AM
Oh I can just place things there ohhhh ok
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
18 Oct 2013 10:03 AM
It appears i did something wrong.....
How do I do it the correct way?
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
18 Oct 2013 10:21 AM
anyone please
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
18 Oct 2013 10:44 AM
bump
Report Abuse
dkeams12 is not online. dkeams12
Joined: 21 Jun 2012
Total Posts: 1992
18 Oct 2013 11:44 AM
2
Report Abuse
Meleos is not online. Meleos
Joined: 13 Oct 2013
Total Posts: 171
18 Oct 2013 11:45 AM
Please, don't make more than one post on the same question.

Yours truly, Meleos
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