Scripting for Anti-Camp Mod

Want to recruit some people for your mod ? Want to work on a mod ? Post the relevant info here. Not for mapping questions.

Moderator: Moderators

Post Reply
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Scripting for Anti-Camp Mod

Post by HeavenBound »

Hey guys! I'm a new modder...I've made a mod for my clan, that if you camp for 20 seconds, a bomb attatches to your head. I would like the bomb to attatch to your butt (actually one of the admins want that) but in the script "Butt" doesn't work...suggestions?
HeavenBound

I'm new at this :)
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

Did you try arse or ass? :D

I am not a scripter but try this

Code: Select all

buttbomb:
 
local.player = parm.other   // defines who is touching the trigger
local.player attachmodel models/ammo/us_bomb.tik "bip01 Pelvis"
Image
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Post by HeavenBound »

211476 wrote:Did you try arse or ass? :D

I am not a scripter but try this

Code: Select all

buttbomb:
 
local.player = parm.other   // defines who is touching the trigger
local.player attachmodel models/ammo/us_bomb.tik "bip01 Pelvis"
U are the man! Pelvis worked like a charm! Thanks! :D
HeavenBound

I'm new at this :)
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

U are the man! Pelvis worked like a charm! Thanks!
I am as surprised as you are, didn't know I had it in me
Image
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Post by HeavenBound »

211476 wrote:
U are the man! Pelvis worked like a charm! Thanks!
I am as surprised as you are, didn't know I had it in me
lol

well, i have another delema...it blows opponents up. It's a punishment, not a reward. Fix?
HeavenBound

I'm new at this :)
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

well, i have another delema...it blows opponents up. It's a punishment, not a reward. Fix?
You mean if they get close to an opponent they blow up too? try posting the script up here
Image
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Post by HeavenBound »

211476 wrote:
well, i have another delema...it blows opponents up. It's a punishment, not a reward. Fix?
You mean if they get close to an opponent they blow up too? try posting the script up here
Yeah if they get to close they go BOOOOM!!

aight here is the script...

main:

local.master = spawn ScriptMaster

local.master aliascache bombtick1 sound/items/Item_Timer_01.wav soundparms 0.7 0.0 1.0 0.0 10000 10000 local loaded maps "m1l2a m2 m3 m4l3 m5 m6l1 m6l3d dm moh obj train"

local.player=self

if(local.player.trigger!=1)
{
local.player.trigger=1
}
else
{
end
}

local.still = spawn trigger_multiple
local.still.origin = self.origin
local.still setsize ( -10 -10 -10 ) ( 10 10 10 )

for(local.timer=0;local.timer<20;local.timer++)
{
if!(self istouching local.still)
{

local.player.trigger=0
local.still delete
end
}

wait 1
}
local.player.trigger=0
local.still delete

local.mine = spawn script_model
local.mine model "items/explosive.tik"
local.mine.origin = ( local.player gettagposition "Bip01 Pelvis")//local.player.origin//
local.mine notsolid


local.mine attach local.player "Bip01 Pelvis"

local.player stopwatch 10


self iprint "Camping Get's You no where..." 1
self iprint "BOOOOOOOOM!!"
self stufftext "say I'm a camper and am going to explode."

self playsound streamed_dfr_scripted_M3L1_016a

self loopsound bombtick1

local.timer=0

while(isalive self)

{
wait 1
local.timer++
if(local.timer==10)
{
self stoploopsound bombtick1
local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"
local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
local.mine remove
local.Exp1.origin = local.mine.origin
local.Exp1 anim start
local.Exp2.origin = local.mine.origin
local.Exp2 anim start
wait 1
local.Exp1 remove
local.Exp2 remove
local.player.trigger=0
}
}

self stoploopsound bombtick1
local.mine remove
local.player.trigger=0
end


Btw, if u try to use this, it won't work. You have to have another File which i will not give, as this is for my clan only.
HeavenBound

I'm new at this :)
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Use the code thing when posting scripts.

Code: Select all

main:

local.master = spawn ScriptMaster

local.master aliascache bombtick1 sound/items/Item_Timer_01.wav soundparms 0.7 0.0 1.0 0.0 10000 10000 local loaded maps "m1l2a m2 m3 m4l3 m5 m6l1 m6l3d dm moh obj train"

local.player=self

if(local.player.trigger!=1)
{
local.player.trigger=1
}
else
{
end
}

local.still = spawn trigger_multiple
local.still.origin = self.origin
local.still setsize ( -10 -10 -10 ) ( 10 10 10 )

for(local.timer=0;local.timer<20;local.timer++)
{
if!(self istouching local.still)
{

local.player.trigger=0
local.still delete
end
}

wait 1
}
local.player.trigger=0
local.still delete

local.mine = spawn script_model
local.mine model "items/explosive.tik"
local.mine.origin = ( local.player gettagposition "Bip01 Pelvis")//local.player.origin//
local.mine notsolid


local.mine attach local.player "Bip01 Pelvis"

local.player stopwatch 10


self iprint "Camping Get's You no where..." 1
self iprint "BOOOOOOOOM!!"
self stufftext "say I'm a camper and am going to explode."

self playsound streamed_dfr_scripted_M3L1_016a

self loopsound bombtick1

local.timer=0

while(isalive self)

{
wait 1
local.timer++
if(local.timer==10)
{
self stoploopsound bombtick1
//local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"   
local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
local.mine remove
//local.Exp1.origin = local.mine.origin
//local.Exp1 anim start
local.Exp2.origin = local.mine.origin
local.Exp2 anim start
self kill           //kills player
wait 1
//local.Exp1 remove
local.Exp2 remove
local.player.trigger=0
}
}

self stoploopsound bombtick1
local.mine remove
local.player.trigger=0
end

The scriptbazookaexplosion.tik has a radius damage. Which means it damages everyone in the X radius. I commented it out. I left the fx_mortar_dirt in for the "explosion" and added self kill to kill the player and only the player. No one else will be harmed now.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

What he said :D
Image
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Post by HeavenBound »

$oldier Of Ra wrote:Use the code thing when posting scripts.

Code: Select all

main:

local.master = spawn ScriptMaster

local.master aliascache bombtick1 sound/items/Item_Timer_01.wav soundparms 0.7 0.0 1.0 0.0 10000 10000 local loaded maps "m1l2a m2 m3 m4l3 m5 m6l1 m6l3d dm moh obj train"

local.player=self

if(local.player.trigger!=1)
{
local.player.trigger=1
}
else
{
end
}

local.still = spawn trigger_multiple
local.still.origin = self.origin
local.still setsize ( -10 -10 -10 ) ( 10 10 10 )

for(local.timer=0;local.timer<20;local.timer++)
{
if!(self istouching local.still)
{

local.player.trigger=0
local.still delete
end
}

wait 1
}
local.player.trigger=0
local.still delete

local.mine = spawn script_model
local.mine model "items/explosive.tik"
local.mine.origin = ( local.player gettagposition "Bip01 Pelvis")//local.player.origin//
local.mine notsolid


local.mine attach local.player "Bip01 Pelvis"

local.player stopwatch 10


self iprint "Camping Get's You no where..." 1
self iprint "BOOOOOOOOM!!"
self stufftext "say I'm a camper and am going to explode."

self playsound streamed_dfr_scripted_M3L1_016a

self loopsound bombtick1

local.timer=0

while(isalive self)

{
wait 1
local.timer++
if(local.timer==10)
{
self stoploopsound bombtick1
//local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"   
local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
local.mine remove
//local.Exp1.origin = local.mine.origin
//local.Exp1 anim start
local.Exp2.origin = local.mine.origin
local.Exp2 anim start
self kill           //kills player
wait 1
//local.Exp1 remove
local.Exp2 remove
local.player.trigger=0
}
}

self stoploopsound bombtick1
local.mine remove
local.player.trigger=0
end

The scriptbazookaexplosion.tik has a radius damage. Which means it damages everyone in the X radius. I commented it out. I left the fx_mortar_dirt in for the "explosion" and added self kill to kill the player and only the player. No one else will be harmed now.
Sorry, As my sig says, I'm new at this. btw Thanks...Will this still make the explosion noise?
HeavenBound

I'm new at this :)
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

No prob,
Sound? Let me check...yes, the tik has defined the explosion sound for the fx :)
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Post by HeavenBound »

Thanks :D

Ok so i was stupid and misunderstood what i was told....They want the explosion...But They still want the -1 kills....help?


Edit : I think i got it...

Code: Select all

main: 

local.master = spawn ScriptMaster 

local.master aliascache bombtick1 sound/items/Item_Timer_01.wav soundparms 0.7 0.0 1.0 0.0 10000 10000 local loaded maps "m1l2a m2 m3 m4l3 m5 m6l1 m6l3d dm moh obj train" 

local.player=self 

if(local.player.trigger!=1) 
{ 
local.player.trigger=1 
} 
else 
{ 
end 
} 

local.still = spawn trigger_multiple 
local.still.origin = self.origin 
local.still setsize ( -10 -10 -10 ) ( 10 10 10 ) 

for(local.timer=0;local.timer<20;local.timer++) 
{ 
if!(self istouching local.still) 
{ 

local.player.trigger=0 
local.still delete 
end 
} 

wait 1 
} 
local.player.trigger=0 
local.still delete 

local.mine = spawn script_model 
local.mine model "items/explosive.tik" 
local.mine.origin = ( local.player gettagposition "Bip01 Pelvis")//local.player.origin// 
local.mine notsolid 


local.mine attach local.player "Bip01 Pelvis" 

local.player stopwatch 10 


self iprint "Camping Get's You no where..." 1 
self iprint "BOOOOOOOOM!!" 
self stufftext "say I'm a camper and am going to explode." 

self playsound streamed_dfr_scripted_M3L1_016a 

self loopsound bombtick1 

local.timer=0 

while(isalive self) 

{ 
wait 1 
local.timer++ 
if(local.timer==10) 
{ 
self stoploopsound bombtick1 
local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"    
local.Exp2 = spawn "animate/fx_mortar_dirt.tik" 
local.mine remove 
local.Exp1.origin = local.mine.origin 
local.Exp1 anim start 
local.Exp2.origin = local.mine.origin 
local.Exp2 anim start
self kill// this adds the -1 kill, but the explosion is still there..             
wait 1 
local.Exp1 remove 
local.Exp2 remove 
local.player.trigger=0


} 
} 

self stoploopsound bombtick1 
local.mine remove 
local.player.trigger=0 
end 
So u think it will work?
HeavenBound

I'm new at this :)
Post Reply