ULX

Author Topic: Roll the Dice module  (Read 27434 times)

0 Members and 1 Guest are viewing this topic.

Offline bobo0044

  • Newbie
  • *
  • Posts: 8
  • Karma: -1
Re: Roll the Dice module
« Reply #45 on: December 08, 2015, 08:42:27 AM »
- Confirm that you removed the noclip effect:
Code: [Select]
TRTD.AddEffect({name="noclip", duration=20, enable=function(ply)
    ply:SetMoveType(MOVETYPE_NOCLIP)
end, disable=function(ply)
    ply:SetMoveType(MOVETYPE_WALK)
    ply:UnTrap()
end})
The code above should be removed from the original file!

- Confirm that the changes were saved correctly.
- Make sure that the server did, in fact, restart.

If you're still having issues after you tried these things, you'll have to show me the contents of your trtd.lua file.
Code: [Select]

    rtdlist = {}
   
    nodelay = "false"
   
    //--[list BEGIN]--//
   
    rtdlist[1] = function(ply)  //????????????????????????????????????????// nothing
      rtdTextToAll(ply:Nick().." got nothing.","????? "..ply:Nick().." ?????? ?? ???????.")
    end
   
    rtdlist[2] = function(ply)  //????????????????????????????????????????// kill
      ply:Kill()
      rtdTextToAll(ply:Nick().." has been killed!","????? "..ply:Nick().." ????!")
    end
   
    rtdlist[3] = function(ply)  //????????????????????????????????????????// hp+
      local rand = math.random(1,48)
      ply:SetHealth(ply:Health()+rand);
      rtdTextToAll(ply:Nick().." got their health added by "..rand..".","????? "..ply:Nick().." ??????? "..rand.." ??.")
    end
   
    rtdlist[4] = function(ply)  //????????????????????????????????????????// hp-
      local rand = math.random(1,48)
      ply:SetHealth(ply:Health()-rand);
      if (ply:Health()<=0) then
        ply:Kill()
        rtdTextToAll(ply:Nick().." has been killed!","????? "..ply:Nick().." ????!")
      else
       rtdTextToAll(ply:Nick().." got their health added by -"..rand..".","????? "..ply:Nick().." ??????? "..rand.." ??.")
      end
    end
   
    rtdlist[5] = function(ply)  //????????????????????????????????????????// armor+
      local rand = math.random(1,32)
      ply:SetArmor(ply:Armor()+rand);
      if (ply:Armor()>255) then
        ply:SetArmor(255);
      end
      rtdTextToAll(ply:Nick().." got their armor added by "..rand..".","????? "..ply:Nick().." ??????? "..rand.." ?????? ?????.")
    end
   
    rtdlist[6] = function(ply)  //????????????????????????????????????????// ignite
      local rand = math.random(1,16)
      ply:Ignite(rand);
      rtdTextToAll(ply:Nick().." has been ignited by "..rand.." sec.","????? "..ply:Nick().." ????????? ?? "..rand.." ???.")
    end
   
    rtdlist[7] = function(ply)  //????????????????????????????????????????// strip
      ply:StripWeapons();
      ply:Give("weapon_crowbar");
      rtdTextToAll(ply:Nick().." got stripped of all their weapons.","????? "..ply:Nick().." ??????? ??? ???? ??????.")
    end
   
    rtdlist[8] = function(ply)  //????????????????????????????????????????// respawn
      local tempHrtd = ply:Health()
      local tempArtd = ply:Armor()
      local tempGrav = ply:GetGravity()
      ply:Spawn()
      ply:SetHealth(tempHrtd)
      ply:SetArmor(tempArtd)
      ply:SetGravity(tempGrav)
      rtdTextToAll(ply:Nick().." has been respawned.","????? "..ply:Nick().." ????????? ? ??????.")
    end
   
    rtdlist[9] = function(ply)  //????????????????????????????????????????// low gravity
      ply:SetGravity(0.4);
      rtdTextToAll(ply:Nick().." got low gravity.","????? "..ply:Nick().." ??????? ?????? ??????????.")
    end
   
    rtdlist[10] = function(ply) //????????????????????????????????????????// high gravity
      ply:SetGravity(1.6);
      rtdTextToAll(ply:Nick().." got high gravity.","????? "..ply:Nick().." ??????? ??????? ??????????.")
    end
   
    rtdlist[11] = function(ply) //????????????????????????????????????????// 1hp
      ply:SetHealth(1)
      rtdTextToAll(ply:Nick().." got their health setted to 1.","? ?????? "..ply:Nick().." ?????? 1 ??.")
    end
   
    rtdlist[12] = function(ply) //????????????????????????????????????????// frag
      ply:Give("weapon_frag");
      rtdTextToAll(ply:Nick().." has found frag grenade.","????? "..ply:Nick().." ??????? ???????.")
    end
   
    //--[list END]--//
   
    function rtdClientText(ply,s1,s2) //say to player
      if (ply:GetPData("srtdLang","en") == "en") then
        ply:SendLua("chat.AddText(Color(40,40,200),\"[RTD]\",Color(200,200,20),\" "..s1.."\")");
      else
        ply:SendLua("chat.AddText(Color(40,40,200),\"[RTD]\",Color(200,200,20),\" "..s2.."\")");
      end
    end
   
    function rtdTextToAll(s1,s2) //say to all
      for _,v in pairs(player.GetAll()) do
        rtdClientText(v,s1,s2);
      end
    end
   
    function rtdPlayerSay( ply, text, public ) //chat command
      texp = string.Explode( " ", string.lower(text))
      if
        if ply:IsAdmin() then
          rtdClientText(ply,"nodelay = "..texp[3],"nodelay = "..texp[3]);
          nodelay = texp[3]
        else
          rtdClientText(ply,"You are not admin.","?? ?? ?????.");
        end
        return false
      end
  if ((texp[1] == "!rtd") or (texp[1] == "/rtd") or (texp[1] == "rtd")) then
        if ((nodelay == "false") and (os.time() < (ply:GetNWInt("srtdLastUsed",0)+60))) then
          local st = ply:GetNWInt("srtdLastUsed",0)+60-os.time()
          rtdClientText(ply,"Wait "..st.." seconds.","????????? "..st.." ???.");
          return false
        end
        if not(ply:Alive()) then
          rtdClientText(ply,"You're dead.","?? ??????.");
          return false
        end
        rtdClientText(ply,"New roll the dice.","????? ?????? ??????.");
        local r = math.random(1,#rtdlist);
        for k,v in pairs(rtdlist) do
          if (k == r) then v(ply) end
        end 
        ply:SetNWInt("srtdLastUsed",os.time());
        return false
      end
    end
   
    hook.Add( "PlayerSay", "rtdPlayerSay", rtdPlayerSay)
      I made sure it restarted and that's my code
« Last Edit: December 08, 2015, 03:23:27 PM by JamminR »

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Roll the Dice module
« Reply #46 on: December 08, 2015, 09:55:51 AM »
Wh... what? I did not write any of that code, bobo0044... ???

This topic is solely for questions/feedback/support on the dice I wrote.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Roll the Dice module
« Reply #47 on: December 08, 2015, 03:27:14 PM »
I presume there are gamemodes that do armor?
Though I see you have health dice effects, should add armor too, if being used in a gamemode that uses it.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline bobo0044

  • Newbie
  • *
  • Posts: 8
  • Karma: -1
Re: Roll the Dice module
« Reply #48 on: December 09, 2015, 03:37:23 AM »
Wh... what? I did not write any of that code, bobo0044... ???

This topic is solely for questions/feedback/support on the dice I wrote.

WHAT! TEHN WHOS IS IT oh, God it :C I'm sorry I was auctally editing a broke 1 which is old I forgot to delete it sorry <3 anyway thanks for helping me remove noclip PARTY <3

add me on steam pls aswell http://steamcommunity.com/profiles/76561198084713827/

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Roll the Dice module
« Reply #49 on: December 09, 2015, 11:17:52 AM »
I presume there are gamemodes that do armor?
Though I see you have health dice effects, should add armor too, if being used in a gamemode that uses it.
Right! Good idea. I will get on that as soon as I have some more free time. :)

WHAT! TEHN WHOS IS IT oh, God <censor> it :C I'm sorry I was auctally editing a broke 1 which is old I forgot to delete it sorry <3 anyway thanks for helping me remove noclip PARTY <3

add me on steam pls aswell http://steamcommunity.com/profiles/76561198084713827/
Haha. No worries. I friended you.  :)