roddydennvor Posted February 13, 2015 Share Posted February 13, 2015 (edited) Hello there ,, I want to make script when the player play on my server under 13 hours , then the name color on scoreboard is yellow... Server-side local hoursplayed = getElementData(thePlayer, "hoursplayed") if hoursplayed < 13 then exports.global:setPlayerNametagColor(targetPlayer , 255, 255, 0) end This Script not work.. Can you help me please ? Thanks Edited February 13, 2015 by Guest Link to comment
Castillo Posted February 13, 2015 Share Posted February 13, 2015 "< 13" what? how do you define if someone is "new"? do you want to use his online time to define it? Link to comment
roddydennvor Posted February 13, 2015 Author Share Posted February 13, 2015 yes , i want to use his spend time on my server... if his online time under 13 hours then his nametag color on score board turn yellow Link to comment
Castillo Posted February 13, 2015 Share Posted February 13, 2015 In the script you posted, you are using two different player variables, one "thePlayer", and the other "targetPlayer", which one is the real one? can you post the complete code? Link to comment
roddydennvor Posted February 13, 2015 Author Share Posted February 13, 2015 thePlayer Link to comment
Castillo Posted February 13, 2015 Share Posted February 13, 2015 Then, you have to change "targetPlayer" to "thePlayer". Link to comment
roddydennvor Posted February 13, 2015 Author Share Posted February 13, 2015 not working... Link to comment
Castillo Posted February 13, 2015 Share Posted February 13, 2015 Post your entire script. Link to comment
roddydennvor Posted February 13, 2015 Author Share Posted February 13, 2015 s_nametag local hoursplayed = getElementData(thePlayer, "hoursplayed") if hoursplayed < 13 then exports.global:updateNametagColor(source) end nametag function updateNametagColor(thePlayer) if getElementData(thePlayer, "hoursplayed") < 13 then setPlayerNametagColor(thePlayer, 255, 255, 0) end end for key, value in ipairs( getElementsByType( "player" ) ) do updateNametagColor( value ) end Link to comment
Castillo Posted February 13, 2015 Share Posted February 13, 2015 That's your entire code...? Link to comment
roddydennvor Posted February 13, 2015 Author Share Posted February 13, 2015 im so confused .. I just want to make that script from zero.. Can you help me to make this script ? Link to comment
roddydennvor Posted February 13, 2015 Author Share Posted February 13, 2015 function updateNametagColor(thePlayer) if getElementData(thePlayer, "hoursplayed") < 13 then setPlayerNametagColor(thePlayer, 255, 255, 0) end end Link to comment
roddydennvor Posted February 13, 2015 Author Share Posted February 13, 2015 haha i can make this script ! yeah,,, so simple but make me confused thanks for your help Solidsnake14 ,, Please Lock this thread Link to comment
Castillo Posted February 13, 2015 Share Posted February 13, 2015 I'm glad you figured it out, what was the problem? someone else might have a similar problem, and this could help. Link to comment
..:D&G:.. Posted February 13, 2015 Share Posted February 13, 2015 This script sounds valhalla to me "the export" Link to comment
roddydennvor Posted February 13, 2015 Author Share Posted February 13, 2015 i forget to add "function updateNametagColor(thePlayer)" 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