SSMCMDS.portal={info=\"Teleports you to the base\";};
function SSMCMDS.portal:func(player,msg)
if(g_gameRules.class~=\"PowerStruggle\")then
return;
end
local hqs=System.GetEntitiesByClass(\"HQ\");
local hq=nil;
if(hqs)then
for i,v in pairs(hqs) do
if(g_gameRules.game:GetTeam(v.id)==g_gameRules.game:GetTeam(player.id))then
hq=v;
break;
end
end
end
if(not hq)then
Chat:SendToTarget(nil,\"No HQ found!\");
end
local price=100;
if(g_gameRules.class==\"PowerStruggle\")then
local playerPP=g_gameRules:GetPlayerPP(player.id);
if(playerPP<price)then
Chat:SendToTarget(nil,player,\"You dont have enough PP (\"..price..\")\")
return;
end
g_gameRules:AwardPPCount(player.id,-price);
end
if(IsCommandUsableForPlayer(\"portal\",player,30,true)==true)then
local pos=hq:GetPos();
pos.z=pos.z+2;
pos.y=pos.y+30;
local expos=player:GetPos();
expos.z=expos.z+7;
g_gameRules:CreateExplosion(player.id,wormhole,1,expos,g_Vectors.up,1,1,1,1,\"misc.sphere_energy.sphere_creation\",0.5, 0.5, 0.5, 0.5);
Script.SetTimer(6500,function()
TeleportPlayer(player,pos);
end);
end
end
This code works on all maps, and costs 100PP, usable every 30 seconds.❤️ 0