IronNoob

Please login or register.

Login with username, password and session length
Advanced search  

News:

Migrated to dedicated hosting. Post any weirdness you observe in the Lounge.

Author Topic: Need scripting help.  (Read 56 times)

0 Members and 1 Guest are viewing this topic.

Darkeness

  • Newbie
  • *
  • Offline Offline
  • Posts: 21
    • View Profile
Need scripting help.
« on: April 20, 2013, 11:23:26 am »

Is there a way to random spawn a tool/model?

Having a % on spawning the sword tool?
Like the % on game.Lighting.WeaponName:Clone() = Workspace?
Logged
~~~~~~~~~~~~~~~~
I may be a Mobster
But I was a Hero
~~~~~~~~~~~~~~~~

Arclordrpg

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 413
  • Made of Pixels
    • View Profile
Re: Need scripting help.
« Reply #1 on: April 21, 2013, 02:51:15 pm »

Like for example, 50% chance of doing something?
Logged

spacek531

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1188
  • Building Roblox coasters since 2008
    • View Profile
Re: Need scripting help.
« Reply #2 on: April 21, 2013, 02:53:36 pm »

yes.
Logged
my race track
Now with less lag and less understeer!

Darkeness

  • Newbie
  • *
  • Offline Offline
  • Posts: 21
    • View Profile
Re: Need scripting help.
« Reply #3 on: April 21, 2013, 04:04:34 pm »

Like for example, 50% chance of doing something?

Yea like
50% on the RegSword to spawn
20% on FireBrand to spawn
15% on Illumia to spawn
10% on DarkHeart to spawn
2.5% on Dualdarkheart to spawn
2.5% on DualIllumia to spawn
Logged
~~~~~~~~~~~~~~~~
I may be a Mobster
But I was a Hero
~~~~~~~~~~~~~~~~

Darkeness

  • Newbie
  • *
  • Offline Offline
  • Posts: 21
    • View Profile
Re: Need scripting help.
« Reply #4 on: April 21, 2013, 07:32:11 pm »

Logged
~~~~~~~~~~~~~~~~
I may be a Mobster
But I was a Hero
~~~~~~~~~~~~~~~~

spacek531

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1188
  • Building Roblox coasters since 2008
    • View Profile
Re: Need scripting help.
« Reply #5 on: April 21, 2013, 07:46:10 pm »

function decide()
a = math.random()
if a < 0.5 then print("normal")
elseif a < 0.70 then print("firebrand")
elseif a < 0.85 then print("Illumia")
elseif a < 0.95 then print("Darkheart")
elseif a < 0.975 then print("DualDarkheart")
else print("DualIllumia")
end
end
Logged
my race track
Now with less lag and less understeer!

Darkeness

  • Newbie
  • *
  • Offline Offline
  • Posts: 21
    • View Profile
Re: Need scripting help.
« Reply #6 on: April 21, 2013, 08:24:57 pm »

function decide()
a = math.random()
if a < 0.5 then print("normal")
elseif a < 0.70 then print("firebrand")
elseif a < 0.85 then print("Illumia")
elseif a < 0.95 then print("Darkheart")
elseif a < 0.975 then print("DualDarkheart")
else print("DualIllumia")
end
end

Thanks  :D
Logged
~~~~~~~~~~~~~~~~
I may be a Mobster
But I was a Hero
~~~~~~~~~~~~~~~~
 

Page created in 0.079 seconds with 22 queries.