Results 1 to 8 of 8
  1. #1
    Keepo123's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Location
    m͏̺͓̲̥̪is̷t̞̖͍͚̤k̥B̸̼&#81
    Posts
    84
    Reputation
    10
    Thanks
    167
    My Mood
    Yeehaw

    [FamusRP] Gmod darkrp SCRIPT

    Code:
    hook.Add("Think", "GodMode", godmode)
    
    function godmode()
    if ( LocalPlayer():Alive() && LocalPlayer():Health() < 75 ) then
       net.Start("buyinghealth")             
                
    net.SendToServer(ply)
    end
    end
    185.38.149.163:27045

    Credit ~ eth0s thanks for that tad bit info it helped me <3

    Code:
    function dupes()
        timer.Simple( 0.4744, function() RunConsoleCommand("say","/drop" .. " ")  end )
        timer.Simple( 1.4135, function() RunConsoleCommand("say","/sleep" .. " ")  end )
    end
    
    concommand.Add("dupe", dupes)
    Dupes a weapon your holding (darkrp) (must have /sleep) (yes this is mine, i'm sure someone has made something similar)

    Add me on steam to talk xD: https://steamcommunity.com/profiles/76561198213718259/
    Last edited by Hunter; 01-17-2016 at 03:07 PM.

  2. The Following User Says Thank You to Keepo123 For This Useful Post:

    buckballs (02-08-2016)

  3. #2
    eth0s's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    1,894
    the indentation puts me off
    Code:
    local function godmode()
    	local ply = LocalPlayer()
    	if ( ply:Alive() && ply:Health() < 75 ) then
    		net.Start("buyinghealth") 		           
    		net.SendToServer()
    	end
    end
    
    hook.Add("Think", "", godmode)

  4. #3
    Keepo123's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Location
    m͏̺͓̲̥̪is̷t̞̖͍͚̤k̥B̸̼&#81
    Posts
    84
    Reputation
    10
    Thanks
    167
    My Mood
    Yeehaw
    Quote Originally Posted by eth0s View Post
    the indentation puts me off
    Code:
    local function godmode()
    	local ply = LocalPlayer()
    	if ( ply:Alive() && ply:Health() < 75 ) then
    		net.Start("buyinghealth") 		           
    		net.SendToServer()
    	end
    end
    
    hook.Add("Think", "", godmode)
    Sorry! I should keep that in mind to try to make the code look a little neater.. Again thank you

    - - - Updated - - -

    Quote Originally Posted by eth0s View Post
    the indentation puts me off
    Code:
    local function godmode()
    	local ply = LocalPlayer()
    	if ( ply:Alive() && ply:Health() < 75 ) then
    		net.Start("buyinghealth") 		           
    		net.SendToServer()
    	end
    end
    
    hook.Add("Think", "", godmode)
    When you do local, What do that mean/do? I mean I know what it does kinda, But why do it?

  5. The Following User Says Thank You to Keepo123 For This Useful Post:

    buckballs (02-08-2016)

  6. #4
    eth0s's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    1,894
    Quote Originally Posted by Keepo123 View Post
    Sorry! I should keep that in mind to try to make the code look a little neater.. Again thank you

    - - - Updated - - -



    When you do local, What do that mean/do? I mean I know what it does kinda, But why do it?
    so its not in the _G (global) table and so stuff like anticheats can't access it by just looking through the _G table for it

  7. #5
    Keepo123's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Location
    m͏̺͓̲̥̪is̷t̞̖͍͚̤k̥B̸̼&#81
    Posts
    84
    Reputation
    10
    Thanks
    167
    My Mood
    Yeehaw
    Quote Originally Posted by eth0s View Post
    so its not in the _G (global) table and so stuff like anticheats can't access it by just looking through the _G table for it
    Interesting, Thank you eth0s.

  8. The Following User Says Thank You to Keepo123 For This Useful Post:

    buckballs (02-08-2016)

  9. #6
    2cashs's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Location
    Next door to regans pub
    Posts
    15
    Reputation
    10
    Thanks
    14
    Quote Originally Posted by eth0s View Post
    the indentation puts me off
    Code:
    local function godmode()
    	local ply = LocalPlayer()
    	if ( ply:Alive() && ply:Health() < 75 ) then
    		net.Start("buyinghealth") 		           
    		net.SendToServer()
    	end
    end
    
    hook.Add("Think", "", godmode)
    The entire thing puts me off.

    The correct way is to put this in the CreateMove hook.
    As things about your player are called as this is ran...
    The entire point of this is to run it as fast as possible, so you should run it in createmove and also not use :Alive() as it is very slow.
    Code:
    hook.Add("CreateMove", "", function() // use CreateMove as it is called when data like your health is called, retard.
    		if(LocalPlayer():Health() > 0 && LocalPlayer():Health() < LocalPlayer():GetMaxHealth()) then
    			net.Start("buyinghealth");
    			net.SendToServer();
    		end
    end

  10. #7
    Keepo123's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Location
    m͏̺͓̲̥̪is̷t̞̖͍͚̤k̥B̸̼&#81
    Posts
    84
    Reputation
    10
    Thanks
    167
    My Mood
    Yeehaw
    Quote Originally Posted by 2cashs View Post
    The entire thing puts me off.

    The correct way is to put this in the CreateMove hook.
    As things about your player are called as this is ran...
    The entire point of this is to run it as fast as possible, so you should run it in createmove and also not use :Alive() as it is very slow.
    Code:
    hook.Add("CreateMove", "", function() // use CreateMove as it is called when data like your health is called, retard.
    		if(LocalPlayer():Health() > 0 && LocalPlayer():Health() < LocalPlayer():GetMaxHealth()) then
    			net.Start("buyinghealth");
    			net.SendToServer();
    		end
    end
    Thanks, as I am pretty new to new so thank you. just read the // fk you lol, I've been learning lua for 2 weeks so hop off
    Last edited by Keepo123; 11-13-2015 at 08:10 AM.

  11. The Following User Says Thank You to Keepo123 For This Useful Post:

    buckballs (02-08-2016)

  12. #8
    sajev's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    3
    Interesting, Thank you eth0s.
    hh this good

Similar Threads

  1. (Request) GMOD DARKRP MONEY GIVER LUA SCRIPT?
    By xjman19x in forum General
    Replies: 3
    Last Post: 01-12-2015, 08:47 PM
  2. [Tutorial] [GMod] DarkRP ULX Freeze Exploit
    By Jaos in forum Garry's Mod Hacks & Cheats
    Replies: 2
    Last Post: 05-28-2013, 08:11 AM
  3. Gmod, Flood scripts?
    By Roller344 in forum Garry's Mod Discussions & Help
    Replies: 2
    Last Post: 05-13-2013, 05:52 PM
  4. Gmod Propkill script
    By Roller344 in forum Steam Games Hacks & Cheats
    Replies: 1
    Last Post: 04-16-2013, 09:09 AM
  5. [GMOD] SEBI - Script Enforcer Bypass
    By Xenocide in forum Garry's Mod Hacks & Cheats
    Replies: 40
    Last Post: 03-06-2013, 08:40 AM