|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|