1. Post #1
    RedNinja's Avatar
    July 2011
    404 Posts
    I am trying to set to this vehicle HP, maybe 200-300, i dont know, it doesnt matter to me atm, the point is i want to do that
    after the HP is 0, or below 0, it ignites, after 10 seconds explodes and after 30 seconds it just vanishes. I could do that myself
    if it was an entity, but it is not. The only lua file is

    Code:
    local Category = "Half-Life 2"
    
    local function HandleRollercoasterAnimation( vehicle, player )
        return player:SelectWeightedSequence( ACT_GMOD_SIT_ROLLERCOASTER ) 
    end
    
    
    local V = {     
                    // Required information
                    Name = "BF2 Buggy", 
                    Class = "prop_vehicle_jeep_old",
                    Category = Category,
    
    
                    // Optional information
                    Author = "MaKc,Erghize",
                    Information = "Buggy from BF2",
                    Model = "models/bf2bb.mdl",
                    
                    KeyValues = {
                                    vehiclescript    =    "scripts/vehicles/jeep_test.txt"
                                }
                }
    
    
    list.Set( "Vehicles", "BF2 Buggy", V )
    I need it urgently, thanks for whoever helps/tries to.
    Reply With Quote Edit / Delete Reply Windows 7 Israel Show Events Dumb Dumb x 4 (list)

  2. Post #2
    Sorry guys, he already 'has it'. '



    And well, he was just trying to 'see if I have knowledge in coding'



    So don't help him.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Dumb Dumb x 2 (list)

  3. Post #3
    RedNinja's Avatar
    July 2011
    404 Posts
    Sorry guys, he already 'has it'. '



    And well, he was just trying to 'see if I have knowledge in coding'



    So don't help him.
    This guy is pissed because i didnt hire him as a coder.
    Reply With Quote Edit / Delete Reply Windows 7 Israel Show Events Funny Funny x 3Dumb Dumb x 2 (list)

  4. Post #4
    As I said in our chat:

    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Dumb Dumb x 2 (list)

  5. Post #5
    Failure's Avatar
    October 2008
    1,440 Posts
    Well that's interesting, maybe post the whole conversation if you don't mind.

  6. Post #6
    Well that's interesting, maybe post the whole conversation if you don't mind.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Informative Informative x 2 (list)

  7. Post #7
    Failure's Avatar
    October 2008
    1,440 Posts
    Oh, then it's good that I didn't waste my time working on this script.
    Reply With Quote Edit / Delete Reply Windows 7 Poland Show Events Agree Agree x 2Friendly Friendly x 1 (list)

  8. Post #8
    Awesome Gmod Servers!
    brandonj4's Avatar
    September 2011
    2,073 Posts
    Oh, then it's good that I didn't waste my time working on this script.
    Exactly, this kid should get banned for exploiting the good nature of members on Facepunch.
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Funny Funny x 7Winner Winner x 1 (list)

  9. Post #9
    RedNinja's Avatar
    July 2011
    404 Posts
    Exactly, this kid should get banned for exploiting the good nature of members on Facepunch.
    Good nature.... hahahaha man you've made my day
    Reply With Quote Edit / Delete Reply Windows 7 Israel Show Events Dumb Dumb x 9Agree Agree x 1Useful Useful x 1 (list)

  10. Post #10
    dylanb5123's Avatar
    January 2011
    224 Posts
    Good nature.... hahahaha man you've made my day
    hahahaha man stop being a dick
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 6Zing Zing x 1 (list)

  11. Post #11
    I call in friends to rate KatNotDinner dumb (lol)
    nick_9_8's Avatar
    December 2011
    1,651 Posts
    Good nature.... hahahaha man you've made my day
    I took the time to think of an effective situation for this.

    Show us the completed code which works... you have it, after all.

    And don't say you want it to be private, because the coder was most likely going to chuck it in a code box in this thread.

  12. Post #12
    Gold Member
    Sillirion's Avatar
    June 2006
    426 Posts
    i would simply create a box based on the car sized who can only be damaged by weapons, and physics...
    And when it dies remove it with the car with an explosion.
    Reply With Quote Edit / Delete Reply Windows XP France Show Events Agree Agree x 1 (list)

  13. Post #13
    Gold Member
    Divran's Avatar
    April 2008
    2,624 Posts
    So clearly students shouldn't answer the teacher's questions at school, because the teachers already know the answers.

    Obviously.

    EDIT: This is a bit of a roundabout way of finding coders to hire, though.

  14. Post #14
    Failure's Avatar
    October 2008
    1,440 Posts
    I think it will be best to ask Sakarias, he made SCars after all, they're damageable and what not.
    Reply With Quote Edit / Delete Reply Windows 7 Poland Show Events Funny Funny x 2 (list)

  15. Post #15
    Gold Member
    noobcake's Avatar
    November 2006
    3,648 Posts
    the thing with scars is that they're entirely separate entities though

    not based on source vehicles at all

  16. Post #16
    KatNotDinner's Avatar
    June 2011
    792 Posts
    And SCars are made out of a few entites and constraints so they can be laggy if there are many of them plus they get buggy under some conditions.
    Reply With Quote Edit / Delete Reply Windows 7 Greece Show Events Dumb Dumb x 1 (list)

  17. Post #17
    Failure's Avatar
    October 2008
    1,440 Posts
    the thing with scars is that they're entirely separate entities though

    not based on source vehicles at all
    Good point there mate, I thought they were half lua and half source. My bad.


    In my opinion it can be done like someone said earlier, create a box around the vehicle that will take the damage and when the damage hits the critical limit, then remove the vehicle, spawn some eye candy explosion effects and remove the box.
    Reply With Quote Edit / Delete Reply Windows 7 Poland Show Events Agree Agree x 1 (list)

  18. Post #18
    SeveredSkull's Avatar
    October 2008
    1,316 Posts
    I must say you people are brilliant:

    Code:
    function GM:EntityTakeDamage( ent, inflictor, attacker, amount )
    	// If it is a car
    	if ( ent:GetClass() == "prop_vehicle") then
    		ent.health = (ent.health or 100) - amount
    		if ent.health <= 0 then
    			ent:Remove()
    		end
    	end
    end
    Don't need it in game mode format? Just add a hook.
    You people are over thinking this damn thing.

    Edited:

    And you can do your own Timer shit on your own. You have the code already there after all.
    Reply With Quote Edit / Delete Reply Windows Vista United States Show Events Agree Agree x 2 (list)

  19. Post #19
    Gold Member
    Sillirion's Avatar
    June 2006
    426 Posts
    shitty code will not work, don't copy this...
    Reply With Quote Edit / Delete Reply Windows XP France Show Events Dumb Dumb x 5 (list)

  20. Post #20
    SeveredSkull's Avatar
    October 2008
    1,316 Posts
    Dont know what the fuck you are smoking... works fine for me.

    Edited:

    Better yet, explain why its "shitty" code. I gotta hear this...

  21. Post #21
    Gold Member
    Sillirion's Avatar
    June 2006
    426 Posts
    raaah i was thinking it would be for autorun...dunno why.. where it would not work because it would not recognize "gm" btw if you would make a hook, ent in line 2 would cause a problem too...just tryied it to verify i didn't tell shit... Btw i'm sorry man, i was rude, in a bad mood sorry...
    Reply With Quote Edit / Delete Reply Windows XP France Show Events Dumb Dumb x 1 (list)

  22. Post #22
    SeveredSkull's Avatar
    October 2008
    1,316 Posts
    Umm... no it wouldnt. if you make it a hook, parameters stay the same...
    I'll let you quit while you are ahead...

  23. Post #23
    Gold Member
    Sillirion's Avatar
    June 2006
    426 Posts
    you mean like that?

    function EntityTakeDamage( ent, inflictor, attacker, amount )
    	// If it is a car
    	if ( ent:GetClass() == "prop_vehicle") then
    		ent.health = (ent.health or 100) - amount
    		if ent.health <= 0 then
    			ent:Remove()
    		end
    	end
    end
    
    hook.Add("Think", "EntityTakeDamage", EntityTakeDamage) 
    Reply With Quote Edit / Delete Reply Windows XP France Show Events Dumb Dumb x 3Winner Winner x 1 (list)

  24. Post #24
    freemmaann's Avatar
    January 2009
    1,133 Posts
    the thing with scars is that they're entirely separate entities though

    not based on source vehicles at all

    *Caught*

    Was gonna give him a stripped down version of that here, till I started reading the posts bellow.
    Reply With Quote Edit / Delete Reply Windows 7 Lithuania Show Events Funny Funny x 1 (list)