Forum

> > CS2D > Scripts > Spawn zombies at mouse position
Forums overviewCS2D overview Scripts overviewLog in to reply

English Spawn zombies at mouse position

3 replies
To the start Previous 1 Next To the start

old Spawn zombies at mouse position

Hidder
BANNED Off Offline

Quote
Hi, i need script like if some one press F3, he will spawn zombie in his mouse position :3
don't make it for admin

Thanks

old Re: Spawn zombies at mouse position

training
BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mousepos = {}
npc = 1

addhook("join","_join")
function _join(id)
mousepos[id] = {x=0 ,y=0} 
end

addhook("clientdata","cltdata")
function cltdata(id, mode, x, y)
if mode == 2 then
mousepos[id].x, mousepos[id].y = x, y
end
end

function spawn(id)
reqcld(id,2)
local x, y = math.floor(mousepos[id].x/32), math.floor(mousepos[id].y/32) 
parse('spawnnpc '..npc.." "..x.." "..y)
end

addhook("say","actn")
function actn(id,txt)
if txt == "npc" then
spawn(id)
return 1
end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview