Discord Moderators Pirulax Posted May 17, 2017 Discord Moderators Share Posted May 17, 2017 (edited) Hello guys, for some reason debugscript is saying this..Heres my script piece: setElementData(p, "acc:admin", 7) if not getElementData(p, "acc:admin") > 0 then return end Nothing else changes acc:admin. Edit: Found the solution: setElementData(p, "acc:admin", 7) if not (getElementData(p, "acc:admin") > 0) then return end But, i still don't understand, so can someone explain me whats the difference between those code blocks? Edited May 17, 2017 by Pirulax Link to comment
Amine#TN Posted May 17, 2017 Share Posted May 17, 2017 getElementData(p, "acc:admin") > 0 (getElementData(p, "acc:admin") > 0) the difference is in the () Link to comment
Moderators IIYAMA Posted May 17, 2017 Moderators Share Posted May 17, 2017 getElementData(p, "acc:admin") > 0 if not getElementData(p, "acc:admin") > 0 then return end local numberValue = getElementData(p, "acc:admin") -- 7 outputDebugString(not numberValue) -- false false > 0 = Attempt to compare number with boolean (getElementData(p, "acc:admin") > 0) if not (getElementData(p, "acc:admin") > 0) then return end local numberValue = getElementData(p, "acc:admin") -- 7 outputDebugString(numberValue > 0) -- true local result = numberValue > 0 -- true outputDebugString(not result) -- false ( ) <<< priority! 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