Forum

> > CS2D > Scripts > Script Gut bomb
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script Gut bomb

14 replies
To the start Previous 1 Next To the start

old Script Gut bomb

NeptooN
User Off Offline

Quote
Hello us
do you know how to make a scenario you drop a gut bomb and appear 2 things usp and awp? help me?

old Re: Script Gut bomb

Masea
Super User Off Offline

Quote
Things need to be answered by you:
• Will gut bomb be removed when you drop it or will it stay?
• Will the items appear at the tile which we exactly are staying on at that moment, or will they be equipped to yourself?
• Let's say the code is not going to make us equipped these and instead they'll spawn somewhere, will they spawn as messy (randomly-like) or exactly under of us?

So after these questions are answered, the current code could be changed subsequently.

1
2
3
4
5
6
7
addhook("drop", "_drop")
function _drop(id, iid, type, ain, a, mode, x, y)
    if type == 86 then
        parse("spawnitem 1 "..x.." "..y)
        parse("spawnitem 35 "..x.." "..y)
    end
end

old Re: Script Gut bomb

NeptooN
User Off Offline

Quote
@user Masea:
Look. The player throws a gut bomb and an awp and USP appears. Appear in the place where the player threw the gut bomb, can take these things, and they no longer appears if the player does not throw another gut bomb. and if the player threw a gut bomb it disappears.

sorry for my English

old Re: Script Gut bomb

Rainoth
Moderator Off Offline

Quote
hook projectile
function projectile
spawnitem floor(position/32)
end

You'll need cs2d lua cmd addhook, cs2d lua cmd parse, cs2d cmd spawnitem and math.floor functions to accomplish what you want. Naturally, the code above is a pseudo code to point you towards the correct direction.

Good luck

old Re: Script Gut bomb

Rainoth
Moderator Off Offline

Quote
Try to locate where you installed CS2D then navigate to sys/lua/samples/ and look at the files there. They'll teach you a lot about how to make simple things in lua. It's a good place to start.

old Re: Script Gut bomb

Masea
Super User Off Offline

Quote
user NeptooN has written
@user Rainoth: Thank you, but I don't understand this.
Sometimes it is hard hence you should try - to understand. And you should need to want to learn Lua first before you want to do something with Lua.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview