diff --git a/pkg/gm/portalgun/gun_portal.lua b/pkg/gm/portalgun/gun_portal.lua index d078d88..27d358a 100644 --- a/pkg/gm/portalgun/gun_portal.lua +++ b/pkg/gm/portalgun/gun_portal.lua @@ -17,14 +17,28 @@ local thisid = ... +local function set_color(new_r, new_g, new_b) + return function(r,g,b) + if r == 0 and g == 0 and b == 0 then + return new_r, new_g, new_b + else + return r, g, b + end + end +end + if client then - weapon_models[thisid] = model_load({ + local base_model = model_load({ kv6 = { bdir = DIR_PORTALGUN, name = "portalgun.kv6", scale = 1.0/128.0, }, }, {"kv6"}) + weapon_models[thisid] = { + base_model({filt = set_color(0, 92, 172)}), + base_model({filt = set_color(240, 92, 28)}) + } end weapon_names[thisid] = "Portal Gun" @@ -46,7 +60,7 @@ return function (plr) recoil_x = 0.0001, recoil_y = -0.05, - model = client and (weapon_models[thisid] {}), + model = client and weapon_models[thisid][1], name = "Portal Gun", }) @@ -70,8 +84,7 @@ return function (plr) end function this.textgen() - local cols - col = 0xFFC0C0C0 + local col = 0xFFC0C0C0 return col, ((plr.portal_list[1] and "0") or "-").. " "..((plr.portal_list[2] and "0") or "-") end @@ -79,6 +92,11 @@ return function (plr) function this.click(button, state) if button == 1 or button == 3 then -- LMB + if button == 1 then + this.cfg.model = client and weapon_models[thisid][1] + else + this.cfg.model = client and weapon_models[thisid][2] + end if this.ammo_clip > 0 then if state then this.portal_select = (button==1 and 1) or 2 diff --git a/pkg/gm/portalgun/portalgun.kv6 b/pkg/gm/portalgun/portalgun.kv6 index 6f61afe..79e4a6c 100644 Binary files a/pkg/gm/portalgun/portalgun.kv6 and b/pkg/gm/portalgun/portalgun.kv6 differ