Jump to content

Custom Weapon Name


itHyperoX

Recommended Posts

Hi, i making a custom weapon name script, but i got some errors. I tried 4 hours to fix, but i dont know whats wrong.

 

local WeaponNames =
{
    [16] = "Nade",
    [24] = "One Deag"
}
function getWeaponRealName(weapon)
    if weapon then
        local weaponmodel = getWeaponNameFromID(weapon)
        if WeaponNames[weaponmodel] then
            return WeaponNames[weaponmodel]
        else
            return getWeaponIDFromName(weaponmodel)
        end
    end
end

Export:

outputChatBox("#FFFFFF You picked up the ammo. #6F9F86(".. theAmmo ..") #ffffffCustomWeaponName: #6F9F86("..exports.serverFiles:getWeaponRealName(weaponID)..")",player,255,255,255,true)

Pics

 

And i'm gettint this on chat: You picked up the ammo. (20) CustomWeaponName: (0)

 

Thanks any help

 

Link to comment
local WeaponNames =
{
    [16] = "Nade",
    [24] = "One Deag"
}
function getWeaponRealName(weapon)
    if weapon then
if WeaponNames[weapon] then 
  return WeaponNames[weapon]
        else
            return getWeaponIDFromName(weaponmodel)
        end
    end
end

 

208. line is the "else"

Link to comment
  • Administrators
local WeaponNames =
{
    [16] = "Nade",
    [24] = "One Deag"
}
function getWeaponRealName(weapon)
    if weapon then
        if WeaponNames[weapon] then
            return WeaponNames[weapon]
        else
            return getWeaponNameFromID(weapon)
        end
    end
end

 

Edited by LopSided_
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...