CoolAlex4734 Posted July 31, 2022 Share Posted July 31, 2022 Hi Everyone! I'm currently in progress of making an rpg server and I need help with a skript. I haven't made it but I will if I can get my answer! So, basically I want it so that when a mob spawns, for example a pig, it shows something like this, Pig - 10/10. The 10/10 means what health it is. I hope someone can help me! -Alex Always Stay Cool No Matter What! Link to comment Share on other sites More sharing options...
Fletchermed Posted August 1, 2022 Share Posted August 1, 2022 how are you spawning the entity? if you are spawning the entity via skript, then this is what you should do command /pig: trigger: spawn 1 pig at the player set {_health} to health of last spawned pig set the name of the last spawned entity to "Pig - %{_health} * 2%/10" on damage of pig: set {_health} to health of victim set the name of victim to "Pig - %{_health} * 2%/10" the reason you are multiplying the health variable is because the pig max hp is 5, so if you double the variable it doesnt change the hp of the pig but changes the name to 10/10, if that makes sense. otherwise, you could just do 5/5 instead of 10/10 hope this helps Link to comment Share on other sites More sharing options...
Fletchermed Posted August 2, 2022 Share Posted August 2, 2022 just so you know, making an rpg is not easy for new skripters, and if you dont want to figure everything thing out yourself, i recommend some builders and skripters and definitely moderators, trust i'v tried Link to comment Share on other sites More sharing options...
CoolAlex4734 Posted August 2, 2022 Author Share Posted August 2, 2022 Hey @Fletchermed! I'm using Minecraft Mob Spawners to spawn the pigs and is there a way to make it so that when pig spawns set name to that? -Alex Always Stay Cool No Matter What! Link to comment Share on other sites More sharing options...
Fletchermed Posted August 2, 2022 Share Posted August 2, 2022 on spawn of pig: set {_health} to health of last spawned pig set the name of the last spawned entity to "Pig - %{_health} * 2%/10" on damage of pig: set {_health} to health of victim set the name of victim to "Pig - %{_health} * 2%/10" here you go Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now