Thanks for the help.
Forum
CS2D Scripts Auto equip on spawnAuto equip on spawn
14 replies 1
Thanks for the help.
By Auto-Equipping he means Lua Scripts, not Console Commands.
1
2
3
4
2
3
4
addhook("spawn","spawn") function spawn(id) 	parse("equip "..id.." 60") end
spawn
Quote
Attention: Do NEVER use the "equip" command within this hook! It will probably lead to problems! Use the return value of the hook instead!
Pls don't open the Spoiler
this is the nearest result
That code will spawn a Gaskmask Beneath you
1
2
3
4
2
3
4
addhook("spawn","Equip_") function Equip_(id) 	return 60 end
The code Mora gave you should suffice unless you need more.
cause i want the ct's in my map to instantly come with a gasmask on them.
so it fits the lore of the map more
I could share the code but I'm not at the home now. It basically would be about spawning a gas mask under the player and set player position to anywhere and set back to the original position. And you'll eventually be equipped with a gas mask.
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("spawn", "_spawn") function _spawn(p) 	parse("spawnitem 56 "..player(p, "tilex").." "..player(p, "tiley")) 	local x, y = player(p, "tilex"), player(p, "tiley") 	parse("setpos "..p.." "..(player(p, "tilex") + 0.5) * 32 + 16 .." ".. (player(p, "tiley") + 0.5) * 32 + 16) 	parse("setpos "..p.." "..x * 32 + 16 .." ".. y * 32 + 16) end
my method
1