roaddog Posted May 29, 2014 Share Posted May 29, 2014 Hello, I have a problem with this, it doesnt show the gang in scoreboard, no errors, but I have tried all my best but I couldnt solve it so,, exports [ "scoreboard" ]:addScoreboardColumn ( "Gang",getRootElement() ,40,80, "Gang" ) function getgang() local group = exports.groupsystem: getPlayerGroup(source) if group then setElementData(source, "Gang", getPlayerGroup(source)) else group = "None" end end Link to comment
Mr_Moose Posted May 29, 2014 Share Posted May 29, 2014 exports [ "scoreboard" ]:addScoreboardColumn ( "Gang",getRootElement() ,40,80, "Gang" ) function getgang() local group = exports.groupsystem:getPlayerGroup(source) if group then outputChatBox(group) setElementData(source, "Gang", group) end end addCommandHandler ( "getgroup", getgang ) You can't call an exported function without including it, I assume that the first exported function returns the name of a group as a string and adds it to the local variable "group", secondly you must add a command handler or similar, otherwise your function will never be triggered. During the test phase it's also good to verify that the exported function actually returns something, if it does you will see that as a chat output. Good luck. Link to comment
roaddog Posted May 29, 2014 Author Share Posted May 29, 2014 Still doesnt work, and I tried using runcode like this setElementData(getPlayerFromName('Limbaws'), "Gang", exports["groupsystem"]:getPlayerGroup(getPlayerFromName('Limbaws'))) works, but the script doesnt Link to comment
Mr_Moose Posted May 29, 2014 Share Posted May 29, 2014 Looks like I forgot to define the player, my mistake, try this: exports [ "scoreboard" ]:addScoreboardColumn ( "Gang",getRootElement() ,40,80, "Gang" ) function getgang(player) local group = exports.groupsystem:getPlayerGroup(player) if group then outputChatBox(group) setElementData(player, "Gang", group) end end addCommandHandler ( "getgroup", getgang ) Link to comment
roaddog Posted May 29, 2014 Author Share Posted May 29, 2014 Oh, It's working now thanks for the help 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