Search the Community
Showing results for tags 'chest'.
Found 1 result
Reputation Ticket/Chest ItemHello 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