Jones 36 Report post Posted April 2, 2016 Hello guys, I've written a script that creates a chest that gives you Reputation when you use it. The script is also explained. function ItemUse_rep_ticket ( role , item ) local curr_rep = GetChaAttr ( role , ATTR_FAME ) -- Gets the character's current reputation. [ role , ATTR_FAME ] = variable for reputation. local rep_ticket_add = 100000 -- Input here the amount of reputation you want the reputation ticket to give local after_add_rep = curr_rep + rep_ticket_add -- Calculate [after_add_rep] as curr_rep (Current Reputation) + rep_ticket_add. if curr_rep > 9999999 then -- If current reputation is over 9.99 mil, then.. SystemNotice( role , "You have over 9 Million reputation! Your account is saturated!") -- Inititate a System Message UseItemFailed ( role ) -- Fail to use the item. else -- If the current reputation is NOT over 9.99mil, then... SetCharaAttr( after_add_rep , role , ATTR_FAME ) -- Set the character's Reputation to the Calculated value (after_add_rep). end -- end the if end -- end the function This script gives you 100k reputation (you can change it by changing value of "rep_ticket_add" and will fail if the user's current reputation is over 9.99 mil, initiating a system message that says: "You have over 9 Million reputation! Your account is saturated!" Credits to Jones of BPO 1 Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted April 2, 2016 (edited) it's nice to see guides like these. Because I've seen you post quite abit of guides lately, let me propose a guide that maybe you could do and even learn through it. (If you decide to take on the challege and needs help with some function, please pm me!) So heres the basis: Go through each built-in function and explain it's functionality. For example: GetChaAttr(userdata, attr) -- retrieves an attr of a given player (userdata) TurnToCha(userdata) -- retrieves playerdata (useful when player is a ship) Notice(string) -- writes a string to the ingame chat console (globally) SystemNotice(userdata, string) -- writes a string to the ingame chat console (individually - "userdata") Edited April 2, 2016 by xtc Quote Share this post Link to post Share on other sites
Jones 36 Report post Posted April 2, 2016 3 hours ago, xtc said: it's nice to see guides like these. Because I've seen you post quite abit of guides lately, let me propose a guide that maybe you could do and even learn through it. (If you decide to take on the challege and needs help with some function, please pm me!) So heres the basis: Go through each built-in function and explain it's functionality. For example: GetChaAttr(userdata, attr) -- retrieves an attr of a given player (userdata) TurnToCha(userdata) -- retrieves playerdata (useful when player is a ship) Notice(string) -- writes a string to the ingame chat console (globally) SystemNotice(userdata, string) -- writes a string to the ingame chat console (individually - "userdata") like a collaboration of work to define the variables? sounds interesting. Quote Share this post Link to post Share on other sites