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 » Scripters
Home Search
 

Re: Pick 1 of 2 scripts random

Previous Thread :: Next Thread 
ProductiveMrduck is not online. ProductiveMrduck
Joined: 03 Mar 2011
Total Posts: 393
27 Sep 2016 12:47 PM
So I have a click detector and 2 scripts working off that and I want it to pick on randomly, I'm not asking for a script but is it possible and is there any wiki explaining how this could be done? :-)

(extra good if I could make it so one of them is rarer then the other)


Report Abuse
fabuss254 is not online. fabuss254
Joined: 08 Dec 2013
Total Posts: 133
27 Sep 2016 01:03 PM
Yes just use the remote function

Just connect tout gui with à when clicked Script and the Script is

Function OnClick()
local i = math.random(1, 2)
If i == 1 then
-- here the path to the remote function
If i == 2 then
-- here the path to the second remote function
End
End


-- here the connect to the click on the button

If you Don't understand there is à tutorial about remote function on the wiki

Good Luck :-D
Report Abuse
ProductiveMrduck is not online. ProductiveMrduck
Joined: 03 Mar 2011
Total Posts: 393
27 Sep 2016 01:05 PM
Before I try this, the point of why I want it to pick random is because the scripts themself uses lines of (PlayerWhoClicked) so will that still be connected? else the scripts won't work

Thx for the reply btw!


Report Abuse
fabuss254 is not online. fabuss254
Joined: 08 Dec 2013
Total Posts: 133
27 Sep 2016 01:09 PM
Oh i forget here is à Script with 20℅ rare and 80% normal

Function OnClick()
local i = math.random(1, 100)
If i <= 80 then
-- normal Script
If i >= 81 then
-- put rare Script
End
End
Report Abuse
fabuss254 is not online. fabuss254
Joined: 08 Dec 2013
Total Posts: 133
27 Sep 2016 01:13 PM
For the whoclicked add this to my Script
Just add the local player = game.Players.LocalPlayer
And the Script i have donate to you just make it Get local
:-)
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
27 Sep 2016 01:31 PM
@fab
Why are you capitalising stuff in the script? Function, End and If will not work.
Report Abuse
fabuss254 is not online. fabuss254
Joined: 08 Dec 2013
Total Posts: 133
28 Sep 2016 03:54 PM
I know but i'm on phone So this capitalize auto
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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