Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.37 KB | None | 0 0
  1. hook.Add("PlayerSay","accessden", function(ply, msg)
  2. if msg == "!rtd" then
  3.     ply:PrintMessage(HUD_PRINTTALK, "This addon is not released yet.")
  4. end
  5. end)
  6.  
  7. // ty "White Noise"  
  8.  
  9. function PrintAll( text )
  10.     for k,v in pairs (player.GetAll()) do
  11.         v:PrintMessage( HUD_PRINTTALK, text )
  12.     end
  13. end
  14.  
  15. allowedGroups = {}
  16. allowedGroups.ulx = {  // sktable
  17. "donator",
  18. "superadmin",
  19. "admin",
  20. "moderator",
  21. "developer",
  22. "owner",
  23. "badmin",
  24. "trusted" }
  25.  
  26. debugEnabled = 1
  27.  
  28. if debugEnabled == 1 then
  29.     hook.Add("PlayerSay","debug",function(ply,text)
  30.         if text == "!debug" then
  31.             PrintMessage(HUD_PRINTTALK, "Status: 1")
  32.         end
  33.     end)
  34. end
  35.  
  36. hook.Add("PlayerSay","don8or", function(ply, msg)
  37. if msg == "!rtd" && (ply:IsUserGroup("user")) then // yes another function but i don't care
  38.     ply:PrintMessage(HUD_PRINTTALK, "You must be a member to roll the dice.")
  39. end
  40. end)
  41.  
  42. hook.Add( "PlayerSay", "Roll The Dice", function( ply, text )
  43.    if text=="!rtd" and ply:GetNWBool( "rtd_delay" )==false and ply:Alive() && (!ply:IsUserGroup("user") ) then// || ply:IsUserGroup("member")) then // usergroup modification
  44.        ply:SetNWBool( "rtd_delay", true )
  45.         dy = os.time()
  46.        timer.Simple( 90, function() // time modified
  47.            ply:SetNWBool( "rtd_delay", false )
  48.        end)
  49.        local dice = math.random(1,16)
  50.        if dice==1 then
  51.            ply:Ignite( 3 )
  52.            PrintAll( ply:Nick().." was set on fire!" )
  53.        elseif dice==2 then
  54.            ply:SetHealth( ply:Health()+math.random(-25,25) )
  55.            PrintAll( ply:Nick().." got his health got altered!" )
  56.        elseif dice==3 then
  57. ply:SetNWInt( "colors", 1 )
  58.            PrintAll( ply:Nick().." can now change the color of props with their use button!" )      
  59.        elseif dice==4 then
  60.            ply:SetHealth( 105 )
  61.            PrintAll( ply:Nick() .." got his health set to 105! " )
  62.        elseif dice==5 then
  63.            PrintAll( ply:Nick() .." is now an ammo magnet!" )
  64.            hook.Add( "Think", "Magnet_"..ply:Nick(), function()
  65.                local et = ents.FindInSphere( ply:GetPos(), 128 )
  66.                for k,v in pairs (et) do
  67.                    if string.find( v:GetClass(), "item" ) and ply:Alive() then // hehe, i like dis
  68.                        v:GetPhysicsObject():SetVelocity( ply:GetPos()-v:GetPos() )
  69.                    end
  70.                end
  71.            end)
  72.       elseif dice==6 then
  73.            local randtime = math.random( 4,16 )
  74.            ply:SetEyeAngles( Angle( 0, 0, 180 ) )
  75.            timer.Simple( randtime, function()
  76.                ply:SetEyeAngles( Angle( 0, 0, 0 ) )
  77.            end)
  78.            PrintAll( ply:Nick().." got their vision flipped for "..randtime.." seconds!" )
  79.        elseif dice==7 then
  80.            local poop = ents.Create( "prop_physics" )
  81.            poop:SetModel( "models/Gibs/HGIBS_spine.mdl" )
  82.            poop:Spawn()
  83.            poop:SetPos( ply:GetPos()+Vector(0,0,35) )
  84.            poop:SetMaterial( "models/debug/debugwhite" )
  85.            poop:SetColor( Color( 51, 40, 28, 255) )
  86.            ply:EmitSound( "npc/barnacle/barnacle_crunch3.wav" )
  87.            PrintAll( ply:Nick().." took a solid crap!" )
  88.             // silentk code beyond this point
  89.         elseif dice == 8 then
  90.             //local name = ply:Nick()
  91.             //RunConsoleCommand("ulx","maul", ply:Nick())
  92.             PrintAll(ply:Nick() .. " ponders as nothing happened.")
  93.         elseif dice == 9 then
  94.             local name = ply:Nick()
  95.             RunConsoleCommand("ulx","slap", ply:Nick())
  96.             PrintAll(name .. " was slapped!")  
  97.            
  98.         elseif dice==10 then
  99.            local randtime = math.random( 1,10 )
  100.            ply:GodEnable()
  101.            timer.Simple( randtime, function()
  102.                ply:GodDisable()
  103.            end)
  104.            PrintAll( ply:Nick().." is invincible for "..randtime.." seconds!" )
  105.         elseif dice==11 then // works
  106.             ply:Give("weapon_ttt_knife")
  107.             PrintAll( ply:Nick().." was given a knife!")
  108.         elseif dice==12 then
  109.             local randval = math.random(10, 75)
  110.             ply:Armor(randval)
  111.             PrintAll( ply:Nick().." was given armor that has an armor value of " .. randval )
  112.         elseif dice==13 then
  113.             points = math.random(25,400)
  114.             PrintAll(ply:Nick().." was given " .. points .. " to spend in the pointshop!")
  115.             RunConsoleCommand("ps_givepoints",ply:Nick()..points)
  116.         elseif dice==14 then // works
  117.         if ply:Health() > 67 then
  118.             PrintAll( ply:Nick() .." rolled number 14 and nothing happened ... Strange.")
  119.             else
  120.             local bhealth = ply:Health()
  121.             local halved = bhealth / 2
  122.             local setter = bhealth + halved
  123.             ply:SetHealth(setter)
  124.             PrintAll( ply:Nick().." has had half their health restored!" )
  125.         end
  126.         elseif dice==15 then // works
  127.             local bhealth = ply:Health()
  128.             local halved = bhealth / 2
  129.             local setter = bhealth - halved
  130.             ply:SetHealth(setter)
  131.             PrintAll( ply:Nick().." has been damaged half of their health!" )
  132.         elseif dice==16 then
  133.         PrintAll(ply:Nick().." rolls the jackpot dice and gets: ")
  134.         local jackpot = math.random( 1, 1000 )
  135.         if jackpot == 1 then
  136.             PrintAll("****Something Extremely Rare!")
  137.             RunConsoleCommand("ulx","forcenr", ply:Nick(),traitor)
  138.             elseif jackpot > 1 && jackpot < 26 then
  139.             ply:SetHealth(200)
  140.             PrintAll("***A Massive Health Boost!")
  141.             elseif jackpot > 25 && jackpot < 76 then
  142.             ply:Give("weapon_ttt_knife")
  143.             PrintAll("**A Knife!")
  144.             elseif jackpot > 75 && jackpot < 176 then
  145.             local jackarmor = math.random(50, 255)
  146.             ply:Armor(jackarmor)
  147.             PrintAll("*Heavy Duty Armor!")
  148.             elseif jackpot > 175 then
  149.             PrintAll("Nothing! Unlucky ...")
  150.         end
  151.        
  152.        
  153. end
  154.    elseif text=="!rtd" and ply:GetNWInt( "rtd_delay" ) and ply:Alive() then
  155.     dx = os.time()
  156.     time = dy - dx // okay so you get integers here going up, we want em going down so ...
  157.     // invert and add 90
  158.     timeleft = time + 90
  159.        ply:PrintMessage( HUD_PRINTTALK, "Please wait ".. timeleft .." seconds before RTDing again!" ) // time modification
  160.    elseif not ply:Alive() and text=="!rtd" then
  161.        ply:PrintMessage( HUD_PRINTTALK, "You cannot !rtd while dead!" )
  162.    end
  163. end)
  164.  
  165. hook.Add( "PlayerDeath", "Remove_Hooks", function( ply )
  166.    hook.Remove( "Think", "Magnet_"..ply:Nick() )
  167.    ply:SetNWInt( "colors", 0 )
  168. end)
  169.  
  170. hook.Add( "PlayerUse", "Color Change", function( ply, ent )
  171. if ply:Alive() and ply:GetNWInt( "colors" )==1 then
  172. ent:SetColor( Color( math.random(1,255), math.random(1,255), math.random(1,255), 255 ) )
  173. end
  174. end)  --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement