Tell me how to make a script?
#8
Current version:

[cubescript]
bind mouse1 [ if (checkalias onAttack) onAttack; attack ]
onAttack = [ if (= (curweapon) 8) [ say "Fire in the hole!" ] ]
[/cubescript]

Next version:

[cubescript]checkinit onAttack [ if (= (curweapon) $GRENADES) [ say "Fire in the hole!" ] ][/cubescript]

If you want the message to appear as you let go of the grenade, no matter how long you have "cooked" it, you will need to tweak it a bit:

Current version:

[cubescript]
bind mouse1 [ if (checkalias onAttack) onAttack; WEAPON_USED = (curweapon); attack; onrelease [ if (checkalias offAttack) offAttack ] ]
offAttack = [ if (&& (alive) (= $WEAPON_USED 8)) [ say "Fire in the hole!" ] ]
[/cubescript]

Next version:

[cubescript]
bind mouse1 [ WEAPON_USED = (curweapon); attack; onrelease [ if (checkalias offAttack) offAttack ] ]
offAttack = [ if (&& (alive) (= $WEAPON_USED $GRENADES)) [ say "Fire in the hole!" ] ]
[/cubescript]

As pointed out previously, these kind of scripts are considered spam by many players. I tend to use /ignore on people who use such scripts.
Thanks given by:


Messages In This Thread
Tell me how to make a script? - by ONYX - 28 Dec 12, 07:02AM
RE: Tell me how to make a script? - by 888 - 28 Dec 12, 01:11PM
RE: Tell me how to make a script? - by ONYX - 28 Dec 12, 07:03PM
RE: Tell me how to make a script? - by macm - 28 Dec 12, 07:25PM
RE: Tell me how to make a script? - by ONYX - 28 Dec 12, 07:28PM
RE: Tell me how to make a script? - by Edward - 29 Dec 12, 12:55AM
RE: Tell me how to make a script? - by ONYX - 29 Dec 12, 06:14AM
RE: Tell me how to make a script? - by Bukz - 30 Dec 12, 06:37PM
RE: Tell me how to make a script? - by ONYX - 31 Dec 12, 04:20AM
RE: Tell me how to make a script? - by Bukz - 31 Dec 12, 04:56PM
RE: Tell me how to make a script? - by Edward - 31 Dec 12, 05:15PM
RE: Tell me how to make a script? - by ONYX - 22 Jan 13, 01:43PM
RE: Tell me how to make a script? - by 888 - 22 Jan 13, 08:04PM
RE: Tell me how to make a script? - by ONYX - 01 Feb 13, 08:00AM