Solved Output entity type with underscores

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ZhengYueMoon

Member
Mar 9, 2022
17
0
1
24
so when player kills an entity, it will return the type of the entity, however entity that have spaces in their type name will display with the spaces like "iron golem", "ender dragon", etc. so instead, i want it to output them with underscores like "iron_golem", "ender_dragon", etc.
anyone have any idea on how to do that?
Code:
on death:
    if attacker is player:
        send "%victim's type%" to attacker
        #when I kill an iron golem, it sends me "iron golem" instead of "iron_golem"
[doublepost=1679136253,1679135823][/doublepost]nevermind i found the solution
im gonna post it here if anyone also have that problem
Code:
on death:
    if attacker is player:
        set {_type} to "%victim's type%"
        replace all " " with "_" in {_type}
        send "%{_type}%" to attacker
 
Status
Not open for further replies.