![]() |
Scripting Help
Ok. I need some help with some NPCs I made. I am making a bug-catching system, and I need some help because it won't work online..... It composes of a bottle, net, and butterfly's. This is my bottle code:
// NPC made by BocoBomy if (playerchats && strequals(#c,buy small bug bottle) && playerrupees>=5) { playerrupees-=5; toweapons Small Bug Bottle; client.BugJarCount=15; say2 You can carry up to 15 bugs#b in this bottle! If you want#b to see how many bugs you have#b stored, say "::bug count::"#b without the parenthesis.; } if (playerenters && isweapon) { client.BugJarCount=15; } if (playerenters) { message Small Bug Bottle - 5 Gralat; } if (playerchats && strequals(#c,::bug count::) && isweapon) { say2 You have #v(client.BugCount) bugs stored; } The problem is, client.BugJarCount won't set to 15. I log into RC, check my profile, and it isn't there. Even if I erase the client. and just have it BugJarCount, it still won't work. Can anyone help me out with this? |
It should be:
NPC Code:setstring client.BugJarCount,15; And the say2 should be: NPC Code:say2 You have #s(client.BugJarCount) bugs stored; |
Ok. Also, I am having trouble with this.variables. In my person, this is his code:
// Graal2001 NPC by Stefan Knorr if (created) { // Initialize the attributes showcharacter; setcharprop #3,head0.gif; setcharprop #C0,orange; setcharprop #C1,white; setcharprop #C2,blue; setcharprop #C3,red; setcharprop #C4,black; setcharprop #n,Bug Collector; setcharprop #2,shield1.gif; shieldpower = 1; dir = 2; x+=0.5; setcharani sit,; } if (playerchats && strequals(#c,sell bugs)) { this.BugRemainderCount=client.BugCount%10; //How much bugs are left if uneven amount this.BugGive=client.BugCount-this.BugRemainderCount; this.BugMoney=int(this.BugGive/10); //How much bugs to give this.BugLeft=10-client.BugCount; //How many bugs are left until jar full if (client.BugCount>0) { //If has more than 1 bug if (client.BugCount>=10) { //If has enough to get money playerrupees+=this.BugMoney; //Give money say2 You gave me #v(this.BugGive) bugs.#b You still have #v(this.BugRemainderCount) bugs left.; } else { //Else not enough to give money say2 You only have #v(client.BugCount) bugs!#b You still need #v(this.BugLeft) more bugs!; } } else { say2 You don't have any bugs!; } } if (playertouchsme) { say2 Hi! I am collecting bugs. If#b you catch any bugs, will you#b sell them to me? I will pay#b you 1 Gralat for every 10 bugs#b you give me. Bees are special.#b If you capture a bee, it will#b count towards 2 bugs! I will#b also sell you some supplies#b to catch bugs. Just say,#b "buy" then the itemname.; } In this script, the this.variables don't work right. The weird thing is, they don't even work in offline mode... I catch a bug, and it sets client.BugCount to 1. Notice this portion: You only have #v(client.BugCount) bugs!#b You still need #v(this.BugLeft) more bugs!; this.BugLeft is set by: this.BugLeft=10-client.BugCount; In the debugger, this.BugLeft is equal to 9. But, in the textbox, it says: You only have 1 bugs! You still need 0 more bugs! It should read: You still need 9 more bugs! Can you guys please explain to me what I am doing wrong? this.BugLeft is 9 in the debugger, but it display's zero in the sign... |
| All times are GMT +2. The time now is 11:50 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.