/revive doesn't work

Hello :wave:,
I’am busy learning and trying out lua and fivem dev.
I made a script what needs to revive you when you are dead or when you low on health.
But it doesn’t work :sob:,
Please Help
This is the code i use:
Screenshot 2023-09-23 224204

why did you use -1 in GetPlayerPed?

and why are after then “…” ?

I see in every tutorial that people use -1 and the “…” after then I don’t now I think vscode has added them.

Remove dots and try it out . If it won’t work dm me i will fix this with you

The dots come from VSCode and are only visible to you, so they are not written in. The dots signal to you that you have whitespaces after the else and then and ReviveInjuredPed behind it, for example a space without what comes after it.

But let’s come to your code that you use -1 is no problem that means that you always point on clientside to the own client. So in your example you want the PlayerPed from yourself. Now it is important to know on which side you execute your code here because on serverside you can not point to yourself but you get the source with the parameters. Is your code on clientside or serverside? @BoVisker

Hello Tuncion,
I’m currently not home so I can’t check but i think its clientside.

1 Like