Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

For some reason doesn't matter what string, it still passes in?

script :

local job = string.split(str,",")
if job[1] == "Visitor" or "Raider" then
	print(job[1])
end

for some reason even when job[1] string isn't visitor or raider it still passes and prints job[1] and I don't know why, any ideas?

1 comment

0

you need to do "if job[1] == "Visitor" or job[1] == "Raider then", the "or" is to do another check the first check is false or nil.

1 answer

✓ Accepted answer

You can't just use or you need to check the value again.

local job = string.split(str,",")
if job[1] == "Visitor" or job[1] == "Raider" then
    print(job[1])
end

This discussion is preserved as it was. New answers, comments, and votes are closed.