Scripts / AddPlayerHealth(e,1000) hurts the player?

Author
Message
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 7th Mar 2016 02:39
Hello I'm working on A script that will make n entity heal the player. There don't seem to be a problem with the script it works but the entity instead of healing the player it hurts the player.



One more thing, could anyone explain how to use the Panel command? I can't seem to get it to work.
Markchapman10 is my Skype let's have some dev talk.
Nathan38
13
Years of Service
User Offline
Joined: 13th Feb 2011
Location:
Posted: 7th Mar 2016 07:47 Edited at: 7th Mar 2016 08:04
The script damages the player? That is strange, could be a bug? have you tried maybe using g_PlayerHealth + 100 instead?

Also for the panel command, for example if you wanted to create a box in the lower left corner of the screen you would type: "Panel (2,74,12,97)"

The first two numbers are the upper left corner of the panel, and the second two numbers are the lower right corner of the panel. (I think)

EDIT: I've just given your script a run and it works for me, as in it healths the player. Did you want it to heal just a flat 100 health or constantly heal when E is held? because thats whats happening. If you would like it to be used once, call destroy(e) after the AddPlayerHealth(e)
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Mar 2016 10:10
AddPlayerHealth(e)
No number condition for this as the number is set in the quantity setting in the entity's fpe file.
What you want is
SetPlayerHealth(g_PlayerHealth+100)
(Change the 100 to whatever you want the health to increase by)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 7th Mar 2016 10:43 Edited at: 7th Mar 2016 10:45
Surely there is is something wrong here you are asking for the player to press 'E' after you have pressed 'E', it should be.

HP Pavilion Laptop, AMD A8-4555M APU with Radeon(tm) Graphics HD Graphics 1.6GHz, 8GB Memory, 64 Bit Operating System (Windows 10), 1 TB Hard Drive.

I've got something to say - It's better to burn out than fade away.
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 8th Mar 2016 02:50 Edited at: 9th Mar 2016 02:23
Sorry taz I was playing around with how the code to see what would happen with different things. Thanks guys, sorry I did'nt reply sooner been working all day. Thanks for the replies. Also i have the script on the reptile from fantasy pack.

edit: I just got around to testing it out since I got off a little early. Smallg that worked, I don't know what the deal was with it but ill just do it that way. Thanks a ton everyone!
Markchapman10 is my Skype let's have some dev talk.

Login to post a reply

Server time is: 2024-12-22 13:35:24
Your offset time is: 2024-12-22 13:35:24