Setting up the area in radiant:
trigger_multiple
. Note: your brush must be thick enough to hold the player to properly register.targetname
KVP on the brush to wallrun_trigger
usermaps/mapname/scripts/zm
// Wallrunning
SetDvar( "wallrun_enabled", 1 );
// Enable segments
level thread setup_wallrun();
Then add these three functions outside your main:
function setup_wallrun()
{
players = GetPlayers();
foreach(player in players)
{
player AllowWallRun(false);
player.iswallrunning = false;
}
wallrun_trigger = GetEntArray("wallrun_trigger", "targetname");
foreach(trig in wallrun_trigger)
{
trig thread wallrun_logic();
}
}
function wallrun_logic()
{
while(1)
{
self waittill("trigger", player);
if(!player.iswallrunning)
{
player thread enable_wallrun(self);
}
}
}
function enable_wallrun(trig)
{
self endon("death");
self endon("disconnect");
self.iswallrunning = true;
while(self IsTouching(trig))
{
self AllowWallRun(true);
WAIT_SERVER_FRAME;
}
self.iswallrunning = false;
self AllowWallRun(false);
}
Save and close, rebuild the map. You can now use wallrunning.
Contributors: