Dzsozi (h03) Posted May 17, 2014 Posted May 17, 2014 Hello guys! I've made a level script thingy, but when I try to check if it's working nothing happens. It's based on played hours on the server, I have 81 played hours, and it should output 'lol' to chatbox, but it's not working. What's the problem with my script? function getLevel(playerSource) local playedTime = (getElementData(playerSource, "hoursplayed") or 0) --local currentLevel = (setElementData(playerSource, "playerlevel") or 0) if playedTime then local currentLevel = 0 if playedTime < 5 then currentLevel = 1 elseif playedTime >= 5 and playedTime < 10 then currentLevel = 2 elseif playedTime >= 10 and playedTime < 15 then currentLevel = 3 -- and more ... elseif playedTime >= 80 and playedTime < 85 then currentLevel = 17 outputChatBox("lol") elseif playedTime >= 610 then currentLevel = 100 end return currentLevel else return false end end Debugscript doesn't show errors.
.:HyPeX:. Posted May 17, 2014 Posted May 17, 2014 Try checking whats the output of getElementData(playerSource, "hoursplayed").
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