-Doc- Posted December 20, 2015 Share Posted December 20, 2015 I wanted to display rank emblems in scoreboard but it won't. exports.scoreboard:addScoreboardColumn('Rank') function scoreLevel () local account = getPlayerAccount(source) local level = getElementData(source, "player.level") if isGuestAccount(account) then setElementData(source, "emblem.system", "ranks/guest.png") --Show the image for guest players else setElementData(source, "emblems.system", tostring("Rank_"..level..".png" )) --Show the images rank end end addEventHandler("onPlayerJoin", getRootElement(), scoreLevel) addEventHandler("onPlayerLogin", getRootElement(), scoreLevel) Link to comment
Addlibs Posted December 20, 2015 Share Posted December 20, 2015 (edited) Images in scoreboard are defined in element data in the format of a table, such as the following (applies only to default scoreboard resource) { ["type"] = "image", ["src"] = ":resource/file.ext", -- must include ':resource' part as the scoreboard resource will otherwise look within its own directory for the image (afaik). ["color"] = tocolor(255,255,255,255), ["width"] = 20, ["height"] = 20, } -- Code adapted from 'voice' resource. Edited December 20, 2015 by Guest Link to comment
1LoL1 Posted December 20, 2015 Share Posted December 20, 2015 exports.scoreboard:addScoreboardColumn('Rank') function scoreLevel () local account = getPlayerAccount(source) local level = getElementData(source, "player.level") if isGuestAccount(account) then setElementData(source, "Rank", "ranks/guest.png") --Show the image for guest players else setElementData(source, "Rank", tostring("Rank_"..level..".png" )) --Show the images rank end end addEventHandler("onPlayerLogin", getRootElement(), scoreLevel) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now