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

UserId is correct but it still denies for some reason?

The print() prints my UserId (124020867) but then decides to still deny it even tho the UserId is correct and I haven't been able to figure out why

I have tried restarting studio multiple times aswell which didn't fix it

		if Plr.UserId == "124020867" then
			print("Allowed")
			print(Plr.UserId)
		else
			print("Denied")
			print(Plr.UserId)
		end

2 answers

✓ Accepted answer

Get rid of the quotation marks

1 comment

0

How did i miss something that small

The userid is an integer value, not a string value. Therefore, when checking it, you are checking the integer (124020867), against the string, ("124020867"). This will always return as different from each other datatypes are completely different. To fix this, you need to remove the quotation marks that specify that the number is a string. Then, you will be comparing an integer against an integer, and if it is the correct user, it will print "Allowed."

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