Forum

> > CS2D > Scripts > Need scripts!
Forums overviewCS2D overview Scripts overviewLog in to reply

English Need scripts!

5 replies
To the start Previous 1 Next To the start

old Need scripts!

brofistmsia
User Off Offline

Quote
How to make a script that spawn item will be awp and a tactical shied?

old Re: Need scripts!

Apache uwu
User Off Offline

Quote
The IDs for AWP and the Shield are 35 and 41 respectively.

With lua, this would mean parsing some cs2d cmd spawnitem. Note that the coordinates need to be in tiles.

parse("spawnitem 35 25 25")
parse("spawnitem 41 25 26")

old Re: Need scripts!

brofistmsia
User Off Offline

Quote
No, i want the full script, i doesn't know how to make script... How to make script actually?

old Re: Need scripts!

lucaSWAT
User 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
29
30
function totable(t,match)
     local cmd = {}
     if not match then
          match = "[^%s]+"
     else
          match = "[^"..match.."]+"
     end
     for word in string.gmatch(t,match) do
          table.insert(cmd,word)
     end
     return cmd
end

addhook("say","_say")
function _say(id,txt)
local p = totable(txt)
local cmd = tostring(p[1])
if cmd:lower() == "!weapons" then -- use !weapons spawn weapon 
xx = player(id,"tiley")
xy = player(id,"tilex")
parse("spawnitem 35 "..xy.." "..xx)
parse("spawnitem 41 "..xy.." "..xx)
return 1
end
if cmd:lower() == "!altoequip" then -- use !weapons equip!
parse("equip "..id.." 35")
parse("equip "..id.." 41")
return 1
end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview