// Zombify vscript script by PDA Expert, for usage in MVM. // Big thanks to Timey and Orin with the troubleshooting of the script! // convar Convars.SetValue("tf_forced_holiday", 8) // Actual entity spawning. function zombify_filters() { SpawnEntityFromTable("filter_tf_bot_has_tag" , { targetname = "botzombify_filter_nozombie_tag" negated = 1 require_all_tags = 0 tags = "bot_preventzombify" } ) SpawnEntityFromTable("filter_tf_bot_has_tag" , { targetname = "botzombify_filter_skeleton" negated = 1 require_all_tags = 0 tags = "bot_skeletonify" } ) SpawnEntityFromTable("filter_tf_bot_has_tag" , { targetname = "botzombify_filter_skeletonify" negated = 0 require_all_tags = 1 tags = "bot_skeletonify" } ) SpawnEntityFromTable("filter_multi" , { targetname = "botzombify_filter_preventzombify" negated = 0 filtertype = 0 filter01 = "botzombify_filter_nozombie_tag" filter02 = "filter_blueteam" filter03 = "botzombify_filter_skeleton" } ) SpawnEntityFromTable("filter_multi" , { targetname = "botzombify_filter_preventskeleton" negated = 0 filtertype = 0 filter01 = "botzombify_filter_skeletonify" filter02 = "filter_blueteam" filter03 = "botzombify_filter_nozombie_tag" } ) } function zombify_triggers() { local zombify_trigger = SpawnEntityFromTable("trigger_multiple" , { targetname = "botzombify_zombify_trigger" origin = Vector(0,0,0) spawnflags = 1 filtername = "botzombify_filter_preventzombify" delay = "0.25" "OnTrigger": "!self,RunScriptCode,ZombifyBot(),0,-1" } ) zombify_trigger.KeyValueFromInt("solid", 2) zombify_trigger.KeyValueFromString("mins", "-9999 -9999 -9999") zombify_trigger.KeyValueFromString("maxs", "9999 9999 9999") zombify_trigger.ValidateScriptScope() zombify_trigger.GetScriptScope().ZombifyBot <- function() { // NOTE : not a good way of doing this, but it works and i think its more readable. printl(activator) if (IsPlayerABot(activator) == false) // Checks if the activator is a player. { return // Stop the function from continuing. } activator.AddBotTag("bot_preventzombify") switch(activator.GetPlayerClass()) { case Constants.ETFClass.TF_CLASS_SCOUT: activator.SetCustomModelWithClassAnimations("models/player/scout.mdl") activator.GenerateAndWearItem("Zombie Scout") break; case Constants.ETFClass.TF_CLASS_SOLDIER: activator.SetCustomModelWithClassAnimations("models/player/soldier.mdl") activator.GenerateAndWearItem("Zombie Soldier") break; case Constants.ETFClass.TF_CLASS_PYRO: activator.SetCustomModelWithClassAnimations("models/player/pyro.mdl") activator.GenerateAndWearItem("Zombie Pyro") break; case Constants.ETFClass.TF_CLASS_HEAVYWEAPONS: activator.SetCustomModelWithClassAnimations("models/player/heavy.mdl") activator.GenerateAndWearItem("Zombie Heavy") break; case Constants.ETFClass.TF_CLASS_ENGINEER: activator.SetCustomModelWithClassAnimations("models/player/engineer.mdl") activator.GenerateAndWearItem("Zombie Engineer") break; case Constants.ETFClass.TF_CLASS_DEMOMAN: activator.SetCustomModelWithClassAnimations("models/player/demo.mdl") activator.GenerateAndWearItem("Zombie Demo") break; case Constants.ETFClass.TF_CLASS_MEDIC: activator.SetCustomModelWithClassAnimations("models/player/medic.mdl") activator.GenerateAndWearItem("Zombie Medic") break; case Constants.ETFClass.TF_CLASS_SNIPER: activator.SetCustomModelWithClassAnimations("models/player/sniper.mdl") activator.GenerateAndWearItem("Zombie Sniper") break; case Constants.ETFClass.TF_CLASS_SPY: activator.SetCustomModelWithClassAnimations("models/player/spy.mdl") activator.GenerateAndWearItem("Zombie Spy") break; } } local skeletonify_trigger = SpawnEntityFromTable("trigger_multiple" , { targetname = "botzombify_skeletonify_trigger" origin = Vector(0,0,0) spawnflags = 1 filtername = "botzombify_filter_preventskeleton" delay = "0.25" "OnTrigger": "!self,RunScriptCode,SkeletonifyBot(),0,-1" } ) skeletonify_trigger.KeyValueFromInt("solid", 2) skeletonify_trigger.KeyValueFromString("mins", "-9999 -9999 -9999") skeletonify_trigger.KeyValueFromString("maxs", "9999 9999 9999") skeletonify_trigger.ValidateScriptScope() skeletonify_trigger.GetScriptScope().SkeletonifyBot <- function() { printl(activator) if (IsPlayerABot(activator) == false) // Checks if the activator is a player. { return // Stop the function from continuing. } activator.AddBotTag("bot_preventzombify") activator.SetCustomModelWithClassAnimations("models/bots/skeleton_sniper/skeleton_sniper.mdl") } } if(Entities.FindByName(null, "botzombify_filter_nozombie_tag") == null) { printl("Filters have been spawned!") zombify_filters() } if(Entities.FindByName(null, "botzombify_zombify_trigger") == null) { printl("Triggers have been spawned!") zombify_triggers() }