Im making a Take-Over point, and ive stumped myself. Ive gotten it all set except for one part…Slashing the point to recover its HP and deciding weather or not you are the owner or not. That decides if it goes down, or up. Say you own it, someone comes along and slashes it down to 50HP, you kill him, then you start slashing it back up to 100, but where im stuck , no matter who slashes it still goes UP, ANDDDD it keep going over the max of 100.
// NPC made by Stowen
if (created) {
timeout = 0.05;
}
if (washit) {
if (strtofloat(#a(server.fowner_haven))=strtofloat(#a(#a))){
setstring server.flag_haven,#v(strtofloat(#s(server.flag_haven))+1);
}else setstring server.flag_haven,#v(strtofloat(#s(server.flag_haven))-1)
}
if (timeout){
message #s(server.flag_haven)/100 owned by: #s(server.fowner_haven);
timeout = 0.05;
}
if (timeout) {
if (strtofloat(#s(server.flag_haven))=0){
setstring server.flag_haven,100;
setstring server.fowner_haven,#a;
}
ok so I’ll point out your problematic area in the script.
[script]
if (washit) {
if (strtofloat(#a(server.fowner_haven))=strtofloat(#a(#a))){
setstring server.flag_haven,#v(strtofloat(#s(server.flag_haven))+1);
}else setstring server.flag_haven,#v(strtofloat(#s(server.flag_haven))-1)
[/script]
1)Your missing a semicolon on the last line
2)strtofloat converts a string to a floating point
–for this reason it’s not needed
–your comparing an account to an account, not a string to an account
----instead use strequals
------setstring server.flag_haven,(strequals(#a,#s(server.fowner_haven)))?1:-1;