Jump to content
  • 0

Epoch - Custom Script


Mink

Question

I'm currently working on a custom script and I'm wondering if anyone knows how to make it so something can only be used once.

 

This is the section of the script that should only be able to be used once. Once the XP is claimed, they shouldn't be able to claim it again.

///VIP 1
//----------------------------------------------------------------------//
if (_uid in _Raven_xpAdd) then { _xpAdd = 10000;
_reason = "BoosterP"; 
_AddXP = [player,_xpAdd,_reason];
publicVariableServer "_AddXP"; };
[nil, player, rSAY, "Lootbox", 100] call RE; //Call S_effect when spawning 
systemchat "<Info> You have successfully bought 10k xp booster pack, Thank you for your purchase!";
sleep 10;
systemchat "<Info> ONLY ONE CLAIM: DO NOT EXPLOIT THIS SYSTEM OR YOU WILL BE BANNED!!!";
};
//----------------------------------------------------------------------//

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
15 hours ago, Mink said:

I'm currently working on a custom script and I'm wondering if anyone knows how to make it so something can only be used once.

 

This is the section of the script that should only be able to be used once. Once the XP is claimed, they shouldn't be able to claim it again.


///VIP 1
//----------------------------------------------------------------------//
if (_uid in _Raven_xpAdd) then { _xpAdd = 10000;
_reason = "BoosterP"; 
_AddXP = [player,_xpAdd,_reason];
publicVariableServer "_AddXP"; };
[nil, player, rSAY, "Lootbox", 100] call RE; //Call S_effect when spawning 
systemchat "<Info> You have successfully bought 10k xp booster pack, Thank you for your purchase!";
sleep 10;
systemchat "<Info> ONLY ONE CLAIM: DO NOT EXPLOIT THIS SYSTEM OR YOU WILL BE BANNED!!!";
};
//----------------------------------------------------------------------//

 

might look like this:

///VIP 1
//----------------------------------------------------------------------//
if (_uid in _Raven_xpAdd) then { 
    if (xpBoosterPack) exitWith {};
    _xpAdd = 10000;
    _reason = "BoosterP"; 
    _AddXP = [player,_xpAdd,_reason];
    publicVariableServer "_AddXP"; };
    [nil, player, rSAY, "Lootbox", 100] call RE; //Call S_effect when spawning 
    systemchat "<Info> You have successfully bought 10k xp booster pack, Thank you for your purchase!";
	xpBoosterPack = true;
    sleep 10;
    systemchat "<Info> ONLY ONE CLAIM: DO NOT EXPLOIT THIS SYSTEM OR YOU WILL BE BANNED!!!";
};
//----------------------------------------------------------------------//
think about initializing the variable in your variable.sqf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...