Blockland Forums > Modification Help
Score donation script
Wheatley:
Ok, I've modified the script about 20 different times and It's working, so I just need to modify a text-color typo and I'll submit it. Thanks for your help, guys!
Destiny/Zack0Wack0:
You did quite a good job actually. If anyone else who had only ever made one script had received my information they would of just requested the script to be written by someone else or just sat there going "HOWDO?".
Deathwishez:
--- Quote from: Wheatley on March 14, 2011, 08:41:28 PM ---messageClient(%target, '', "\c5%client \c6 has donated \c5%score \c6to you.");
--- End quote ---
This is going to look like "103998 has donated 5 to you"
You want this:
--- Code: ---messageClient(%target, '', "\c5%client.getPlayerName() \c6 has donated \c5%score \c6 Points to you.");
--- End code ---
Destiny/Zack0Wack0:
--- Quote from: Deathwishez on March 15, 2011, 02:41:33 AM ---
--- End quote ---
--- Code: ---messageClient(%targetClient, '', "\c5" @ %client.getPlayerName() SPC "\c6 has donated \c5" @ %score SPC "\c6 Points to you.");
--- End code ---
Headcrab Zombie:
A few things.
First, it's a good idea to get in the habit of proper indentation, it makes everything a lot easier to read.
Second, checking if the client's score is greater than one is pointless, as you are allowing them to donate more than one point, as well as later checking if the score they wish to donate is greater than their current score.
Third, you want to check if the score they want to donate is greater than 0, otherwise players can donate zero or negative scores and get all the score they want.
And finally, a personal opinion, it doesn't matter how you do it, but I think having the arguments be target then score makes more sense than score then target.