1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Force a physgun colour for certian groups

Discussion in 'DarkRP Modding Questions & Help' started by [FL:RP] Edned, Jan 5, 2015.

  1. [FL:RP] Edned

    [FL:RP] Edned Member

    Okay, so I have asked this in the past and none of the scripts seemed to work. I remember Cake was contributing quite a lot, although the latest script he created constructed an issue. Basically, if the player was not an admin they would not spawn with any weapons and the player model was a statue! What I need the script to do: Force the pysgun colour to RGB Code (77, 255, 255) if the user was not a ULX admin. Thanks for any help!

    Kind Regards,
    Edward (Edned)
  2. Bo98

    Bo98 Moderator Staff Member Contributor

    Did the previous script work (except for the groups part)? If so then you only need to add "and not ply:IsAdmin()" to the if statement.
  3. Cake

    Cake Active Member

    I remember people changing my code around.... So not sure if you used my one or a modified version of it. Also generally when that happens there is an error in console.
  4. Matryan

    Matryan Well-Known Member

    Did the returning not work?
  5. Cake

    Cake Active Member

    Never tested the code, so I have no idea.
  6. Matryan

    Matryan Well-Known Member

    Alright, just in case, someone throw this in garrysmod\addons\darkrpmodification-master\lua\darkrp_modules\setphyscolor\sh_setphyscolor.lua:
    Code (Text):
    hook.Add("PlayerSpawn", "setphyscolor", function( ply )

        if ply:IsAdmin() then return end

        ply:SetWeaponColor( Vector( 0.3, 1, 1) )


    -- The vector for the color = COLOR / 255
    -- for example: Color(125,90,25) = Vector(0.49, 0.35, 0.1)

Share This Page