|MJK|SkyLord Posted October 30, 2012 Share Posted October 30, 2012 I'm having a problem with an userpanel. it's saying 'Attempt to perform arithmetic on a boolean value. serverside: here is a part, it gives the problem at 'local PlayerTodayTime = math.floor((PlayerCheckTime - getElementData(thePlayer,"joinTime"))/1000)' ------ playedTime local PlayerCheckTime = getTickCount () local PlayerTodayTime = math.floor((PlayerCheckTime - getElementData(thePlayer,"joinTime"))/1000) local PlayerOldTime = loadPlayerData(thePlayer,"playedTime") savePlayerData(thePlayer,"playedTime", PlayerOldTime + PlayerTodayTime) CheckAchievement(thePlayer,6) setElementData(thePlayer,"joinTime", PlayerCheckTime) ------ Link to comment
myonlake Posted October 31, 2012 Share Posted October 31, 2012 Means the player doesn't have "joinTime" data set correctly. You could also try this: local PlayerCheckTime = getTickCount() local PlayerTodayTime = math.floor((PlayerCheckTime - tonumber(getElementData(thePlayer, "joinTime")))/1000) local PlayerOldTime = loadPlayerData(thePlayer, "playedTime") savePlayerData(thePlayer, "playedTime", PlayerOldTime + PlayerTodayTime) CheckAchievement(thePlayer, 6) setElementData(thePlayer, "joinTime", PlayerCheckTime) Link to comment
|MJK|SkyLord Posted October 31, 2012 Author Share Posted October 31, 2012 Means the player doesn't have "joinTime" data set correctly.You could also try this: local PlayerCheckTime = getTickCount() local PlayerTodayTime = math.floor((PlayerCheckTime - tonumber(getElementData(thePlayer, "joinTime")))/1000) local PlayerOldTime = loadPlayerData(thePlayer, "playedTime") savePlayerData(thePlayer, "playedTime", PlayerOldTime + PlayerTodayTime) CheckAchievement(thePlayer, 6) setElementData(thePlayer, "joinTime", PlayerCheckTime) Thank you, i'll try it out 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