Jump to content

Checking global variable


Gravestone

Recommended Posts

I am trying to check a global variable but everytime it is returning false.

something1 = false
something2 = false
something3 = false
something4 = false
something5 = false

function checksomething(_, _, ...)
	local d = table.concat({...}, " ")
	if tostring(d) == true then
	outputChatBox("true")
	return true
	
	else
	outputChatBox("false")
	return false
	end
end
addCommandHandler("checks", checksomething)

But if I do it in this way:

something1 = false
something2 = false
something3 = false
something4 = false
something5 = false

function checksomething(_, _, ...)
	local d = table.concat({...}, " ")
	if something1 == true then
	outputChatBox("true")
	return true
	
	else
	outputChatBox("false")
	return false
	end
end
addCommandHandler("checks", checksomething)

then it will return true. Any ideas how to fix this?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...