Jump to content

Deathscript only Multiplayer map restart


Go to solution Solved by NAB622,

Recommended Posts

Posted

hello I would like to ask for some help! Can anyone make a map_restart script? It would be very important! 😕

only multiplayer

  • Zebon changed the title to Deathscript only Multiplayer map restart
Posted

We'll need a little bit more information than that. Are you talking about ICARUS scripts?

What is the full context of what you are trying to do?

Posted

I want a deathscript for an NPC. When it dies, restart the map. In short, the script should start a command on the server. example: maprestart.ibi should be in such a file, but I can't do it.

I could use gtk radiant to build the script in the npc. I just don't know how to script.

  • Solution
Posted

What you want to do is very easy in theory, however it risks a crash on the game server so I do not recommend it.

 

Regardless, here's how you can do it...

Create a target_level_change, and set the mapname value to the name of the map. Set a targetname on this entity as well. When fired, this will effectively reload your map. (This function is bugged and has a chance to crash the game server!)

In multiplayer, all scripts on an NPC are terminated when they die, including the deathscript, which makes no sense. Instead, try setting NPC_target, and give it the targetname of your target_level_change.

 

Assuming none of these items are bugged, the level should now reload the map when the specified NPC dies.

If you would like a delay before the reload, use a target_delay in between the NPC and the target_level_change.

If you would like printed messages to the players before the level change, use a target_print.

Zebon likes this

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...