ULX

Author Topic: Lua Help (Player Models)  (Read 2396 times)

0 Members and 1 Guest are viewing this topic.

Offline Duke Nukem

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Lua Help (Player Models)
« on: April 09, 2013, 05:49:02 PM »
So, this isn't exactly ULX, but, I want to make it so certain players, or groups, have a certain model, I've figured this out so far, by modding scoreboardcolors.lua.

Code: [Select]
      if ply:IsUserGroup("owner") then
         ply:SetModel(ply._OldModel)
      end

But I can't figure out what to do with the rest of this.

Code: [Select]
if SERVER then
   AddCSLuaFile("scoreboardcolors.lua")
else
   function MySBColors(ply)
      if ply:IsUserGroup("co-owner") then
         ply:SetModel(ply._OldModel)
      end
      if ply:IsUserGroup("owner") then
         ply:SetModel(ply._OldModel)
      end
   end
   hook.Add("TTTScoreboardColorForPlayer", "MySBColors", MySBColors)
end
Any suggestions?

Offline nathan736

  • Full Member
  • ***
  • Posts: 143
  • Karma: 4
Re: Lua Help (Player Models)
« Reply #1 on: April 10, 2013, 06:18:22 AM »
the logic flow would be
Code: [Select]
if target is in the group owner then
set targets model to ply._oldmodel
end
for the next one it would be
Code: [Select]
if server then
add other lua for server only
else -- this means not the server then
create function  mysbcolors with args  ply
if the player is in the group co-owner then
set players model to ply._oldmodel
end
if player is in the group is owner then
set players model to ply._oldmodel
end
end
--ADDING CLIENT HOOK  this is clientside
   hook.Add("TTTScoreboardColorForPlayer", "MySBColors", MySBColors)
end
a person asked me how to code lua and i said this " its like building a rocket up side down then  realizing you did it all wrong."