![]() |
Prevent hurting
Is there any easy way to prevent baddy/player/npc from hurting the player?
|
Um. Make a timeout that continually set's the player's hearts to a certain amount, or set their AP to 100 =P
|
if (playertouchsme) {toweapons Immortal;
} if (weaponfired&&!this.on) {set this.on; setcharprop #c,On.; } else if (weaponfired&&this.on) {unset this.on; setcharprop #c,Off. } while (this.on) { if (playerhearts<playerfullhearts) {playerhearts=playerfullhearts;} or something |
i tested this offline and it worked
PHP Code:
|
I know there's more to getting hit and flying back, but I was wondering if there was a way around it. I wanted to have armor power, sword power, defense power, and attack power, all effect how much damage was done or if the equiped armor would prevent the damage.
|
Is there anyway to prevent the player from flying back?
|
Quote:
|
:confused: would that work well? I mean u would have to disable and re enable pretty fast to be realistic.
|
if (washit) {disableofmovement;
sleep.5; enablemovement; } there would be trouble of they logged off right after being hit i think im not really good at scripting ;\ |
if (playerhurt) {
playerhearts=playerhearts; disabledefmovement; sleep 10000000000000000000000000000000000000; enabledefmovement; } |
Alright so
1. Rescript movement with keydown 2. Script my own damage system. Thanks Kaimetsu, and to everyone else who helped. |
Ugh
I've been trying to rescript movement but it wont work. I do the keydown(0) {playerdir=0;setani walk;y+=.5}
I know I'm doing something wrong, I just can't find it. Any it's no use saying I suck at scripting, I already know that. |
it will be more like:
NPC Code: |
That doesnt work, it makes you die every 3 seconds or so.
|
Jadis:
XDaKreepX, in his godlike ways, made a weapon to keep the player from being hurt. (Meaning the player was not moved back). |
if youre going to make armor then all you simply have to do is check to see if the player got hurt . then you of course need to know his hearts before he got hurt and you would need to compare like if hes got armor it doesnt hurt
here i didnt test this but im just like giving a base NPC Code: considering that baddies do .5 dmg else u have to set string of the current ammount of the player health then check it over or whatever.. okay bye |
I didn't test it but it'll probaly work. Thank alot, by the way. Anyone know if there is a command to check if a player hits another player? Sorta like a playerhitsplayer.
|
if (playertouchsanother)
|
Isn't it playertouchother and it's for npc's.
But is there a playertouchanother? and if it was wouldnt it deal with touching and not hitting them? |
if(playerenters) noplayerkilling;
|
Ha. I need it to detect being hit, fly back, and then lower the player's client.hp string. Dont think nopkzone would help.
|
Quote:
NPC Code: Now, you will need a timeout to set the player X and Y. NPC Code: Try that. |
~AlphaFlame~The Fool~
if (playerhurt){ this.x=playerx; this.y=playery; players[0].hearts+=.5; timeout=.05; } if (timeout && strequals(#m,hurt)){ playerx=this.x; playery=this.y; timeout=.05; } Could that possibly work? o.0 The player will fall backwards just a *tiny* bit (I'm estimating about... .2 or so...), but not much... 0.o |
I need the player to fly back, I just want them not to be hurt unless the attacker's weapon power>players defense and armor.
|
~AlphaFlame~
Well why didn't you say so in the first place! :megaeek: Anyway, try this... if (playerenters){ toweapons -blahblah; setstring armorpower,5; destroy; } if (isweapon){ if (playerhurt){ playerhearts+=.5; if (strtofloat(#s(armorpower))<Whatever it is you're using as the enemy power here){ playerhearts-=I'll let you do the math here ; } } } You'll hafta do what's in blue though, since I have no clue what you're using for your enemy strength, and the ratio you want of armor:enemy strength damage o.0 |
Like I said, I didn't know what he was using for the enemy strength variable, and what amounts he wanted for the damage. He could want .5 for every 1 over, or 1 for every .5... I'm not a mind-reader Kaimetsu ;)
|
*sighs* Now you're wanting me to give him a script he didn't ask for?
Sheesh, do I have amnesia or something? *goes back to read posts* I believe he said Quote:
|
I quote again
Quote:
In there... sure, it is the hardest part. Really the only section he could be talking about? Now you know exactly what he was thinking when he asked that question? Step right up, one and all! The amazing Kaimetsu will astound and amaze by reading your mind! |
Alright Kaimetsu, since I don't have the braincells to...
YOU do it. *giggles like a school girl and runs off* Mwaha [edit] Oh, by the way... you're a fun person to argue with Kaimetsu :D [/edit] |
Bad Script Monkey, arguing with people about helping somebody then not helping them yourself and saving about 10 posts worth of space... tsk tsk... mwehe
|
Kaimetsu does read minds :megaeek:! I wanted to know how to detect the other players attacking power. I stated it in another post. Thanks for trying to help Adrenaline, but I already had that part of the script working perfectly.
|
I see an ego swelling :rolleyes:
|
Quote:
Adren:I find it very nice of you to try to help me, given are past history wasnt too...friendly. |
Beating down your adverseries? Scripting is about SCRIPTING! =/
And plus, what does it hurt to help somebody? ... or are you just scared somebody might become better than you? |
Gloating is fun, but it can get you in some pretty nasty situa-ma-ations.
|
.....
I think I'm a pretty good scripter myself. I dont go around bragging "Im the best, Youre a n00b cause you need help" because i need help with some stuff too. Some people are better at some things than others. Like myself, Im kinda new with arrays, so i asked for help with them. It doesnt mean that i couldnt complete the script i was working on, to be just as good as someone elses script, but i wanted to try a new angle of approach to it. Im sure even you have to ask for help from time to time...and people dont call you a newb scripter, do they? Its just like anything else, the more practice you have at it, the better you are. If someone needs help, I try to help them.... if i know how. If i dont...i will say i dont, or just not post.
Anyway...I posted on page 2 of this... or maybe even 1, and didnt bother to read the following pages until the last, because it takes too damn long, so if im off topic, just disreguard my post, lol. |
true, true
Youre right. But rubbing it in people's faces just makes them mad ;)
|
Quote:
Sheesh, just like learnin the alphabet for the first time, people new to scripting have to learn someplace... |
| All times are GMT +2. The time now is 02:39 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.