Forum

> > CS2D > Scripts > Domination point spawn?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Domination point spawn?

3 replies
To the start Previous 1 Next To the start

old Domination point spawn?

Louie
User Off Offline

Quote
So when a player captures a Domination point then that player's team can spawn near that Domination point and also some turrets and walls will spawn around that domination point(the owner will be the capturing player,or the team of the player),how do i do those things?
EDIT:I tried this,when i captured a domination point it spawns a turret but i want it to spawn near the domination point.
1
2
3
4
5
6
addhook("dominate","a")
function a(id,team,x,y)
local turretX = 5
local turretY = 5
parse("spawnobject 8 "..turretX.." "..turretY.." 0 0 "..team.." "..id)
end
i want a few turrets and some walls to spawn on the Domination point,but i dont know how to do that anyone can help?
edited 5×, last 01.01.15 05:24:56 am

old Re: Domination point spawn?

Joni And Friends
User Off Offline

Quote
This for spawn 1 object near flag dominate
1
2
3
4
5
6
7
8
9
addhook("dominate","a")
function a(id,team,x,y)
p={-1,1}
local turretX=(x+(p[math.random(1,#p)]))
local turretY=(y+(p[math.random(1,#p)]))
        if tile(turretX,turretY,"walkable") then
             parse("spawnobject 8 "..turretX.." "..turretY.." 0 0 "..team.." "..id)
        end
end
This for spawn multiple object near flag dominate
1
2
3
4
5
6
7
8
9
10
11
addhook("dominate","a")
function a(id,team,x,y)
p={{-1,1},{1,-1},{1,1},{-1,-1}}
     for i=1,#p do
          local turretX=x+p[i][1]
          local turretY=y+p[i][2]
        if tile(turretX,turretY,"walkable") then
             parse("spawnobject 8 "..turretX.." "..turretY.." 0 0 "..team.." "..id)
        end
     end
end
edited 3×, last 02.01.15 08:15:01 am

old Re: Domination point spawn?

Louie
User Off Offline

Quote
Thank you very much you have helped me alot,now i will use this in my map
EDIT: tho,how do i do more buildings will spawn in a specific domination point? and how do i delay the spawn of the buildings for like 3s?Ah nevermind the delay thing i found it out by my self
edited 3×, last 02.01.15 10:06:00 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview