![]() |
Adding /roll - Printable Version +- Limelight Forums (https://limelightgaming.net/forums) +-- Forum: Feedback (https://limelightgaming.net/forums/forum-612.html) +--- Forum: Suggestions (https://limelightgaming.net/forums/forum-239.html) +---- Forum: Finished (https://limelightgaming.net/forums/forum-242.html) +---- Thread: Adding /roll (/thread-5783.html) Pages:
1
2
|
Adding /roll - BlackDog - Aug 19, 2015 Suggestion for <in-game.> In detail, explain your suggestion: Simply put, just a /roll command from 1-100 for those who wish to add a bit of flavor to their RPs. Why should this be implemented? For those wanting to add more detail to their RPs its often times not exactly easy to decide who does what in say a fist fight. If i attempt to grab ones arm to gain the upperhand, how do we decide who actualy pulls it off? Often times both want theirs to succeed but choseing isnt exactly easy, with this just /roll and essentialy have it decided for you, depending on how much higher the roll decides just how successfull the action was. This would be optional and meerly there for those who want to make use of it. Me being talked to by an officer about my improperly parked car, that is also a getaway vehicle, i ask the officer if hes willing to go along with a more detailed Roll RP, he agrees. [me=BlackDog]attempts to kick the officer in the balls[/me] /roll (86) Officer rolls to avoid /roll (15) In this case he just got sacked and has no ground to attempt a counter as his roll was so much lower and since he agreed to go along with it, would RP accordingly, adding a bit of flavor to the situation for those involved. Of course if the roll's were reversed, good chance he could now counter the attack and the RP would move in an entirely different direction where neither party is sure how it will end, but that in the end the results we're unexpected, but fair Re: Adding /roll - Joey Skylynx - Aug 19, 2015 Do it, and do it now. +support Re: Adding /roll - Laizel - Aug 19, 2015 +1 Re: Adding /roll - Doodleh - Aug 19, 2015 This would be a great addition. Re: Adding /roll - Lord Octagon - Aug 19, 2015 [move] ![]() +Support
Re: Adding /roll - Faustie - Aug 19, 2015 Approved. Re: Adding /roll - GRiiM - Aug 19, 2015 It would be a nice addition to be able to specify the range of your rolls for some casino/gambling RP (eg. Blackjack) Re: Adding /roll - Jono - Aug 19, 2015 Following the WoW system would be nice. You'd also have to distinguish the color from that of /its etc, as scripts could be set up easily enough. Re: Adding /roll - Vedette - Aug 20, 2015 +Support Re: Adding /roll - Loaf - Aug 20, 2015 Why not make it so you can change the number that it is out of, and the multiple it could be of? For example, roll a d20, /roll 1d20. +support Re: Adding /roll - Spai - Aug 24, 2015 Got bored while sitting around on holiday, so here is a dice system for you guys. Features two console commands "rtd" and "rtd_last" where the "_last" variant shows your previous roll exactly as last ( there is a clear warning stating it was last roll so ya know can't be used later on by others to cheat and such). Uses the Player Metatable so looks pretty clean when used in other scripts simple "PlayerObject:RollDice(Min, Max, #Dice)". You are also able to specify the minimum, maximum and no. Of dice to be used on the roll ( all results are printed out, will probably expand when I get back to have multiple different sized "dice" used for different roles e.g. 2 d20 1 d23 3 d100 or something similar) Cool down is also implemented to prevent spamming but there is no visual indicator that you're on cool down, though it's only 1 second so it's not a huge problem. Anyways onto code etc. https://hastebin.com/epewudileg.lua link to the syntax highlighted version Code: -- Created by Spy (steamcommuntiy.com/id/Snappey) There is all the code that's used. Now how to use in its current state, afaik you guys use the inbuilt plugin system I can't remember all the needed functions for that shit so you know here it is in normal form shove it into lua/autorun for the curious who'd like to try it. How the player can use it is through the console as idk how your chat command system works and there is no need for me to add another not needed hook to your guys GM. Input: rtd 1 100 5 Rolls 5 dies with the range of 1-100 Arg 1: minimum range Arg 2: maximum range Arg 3: amount of times to roll Output: [Dice #1] Rolled 45 (min: 1, max: 100) and so on for each dice roll thereafter, repeated 5 times in our case In hind sight there should be a check to ensure that arg1 is smaller than arg2 or some system that switches them around if need be, but cbf to do that now idk if it'll error or not it might be clever itself. Improvements / changes will no doubt be needed as I have wrote this completely on my phone with no testing or documentation available. Should be fun though might be a small error here and there whatever nothing impossible to fix. Point is general logic and system has been implemented. One major thing required can't remember if I mentioned it or not you guys probably want to make your own chat commands for it. Pretty sure that's everything, sorry if the post is reaaaallly long here is a TLDR I created a basic roll system on my phone tis completely untested however should work fine after reading over a couple of times. You guys want to make your own chat commands as well. Thanks, Spy ![]() Re: Adding /roll - Joey Skylynx - Aug 24, 2015 Welp, seems like we have an RTD system now. Re: Adding /roll - Spai - Aug 25, 2015 Alright two things I'd just remembered that literally anyone with a shred of experience in Lua can fix: 1. You can currently go rtd 1 2 100000 You now have chat spammed and or server frozen and or net library refusing to send a string that large Just limit to 5 I think Joey suggested that was a fine amount 2. You can't actually see who rolled he dice, oversight by me thought I designed it with that in mind turns out I didn't. In the net.WriteString section add the players name to the start. Ez fixes sorry for the bugs ![]() Re: Adding /roll - Rayts5 - Aug 26, 2015 ... What? Why are you utilizing two network variables for this? It does not give sense any sense, you are making the server handle both net.Receive and net.Start lol. Simply make 1 (or 2 if you want to) concommands on the server-side and handle the rolling and such from there. There is absolutley no need to store a network variable on the player, just store a variable on the player instead. Note, careful on your variables. local str = PackageTable(ply:RollDice(args[1], args[2], args[3])) net.WriteString(str) Is the same as net.WriteString(PackageTable(ply:RollDice(args[1], args[2], args[3]))) I know that the above looks better since you store a string, but you are performing 1 extra unnecessary operation. Also, in your GetNearbyPlayers function, just store 1 table instead before the function, otherwise you will keep adding tables in the stack which is generally a bad idea (unless you want it to overflow lol, I do not believe Lua had a garbage collector). At start, clear the table and then add the players to the table. Re: Adding /roll - Voluptious - Aug 26, 2015 (Aug 26, 2015, 03:30 PM)Rayts5 link Wrote: Note, careful on your variables. Its easier to read and debug if you do it this way, I do things like this aswell |