function checkRoom(player, room)
print(room)
if room == "Room1" then
print("room one")
wait(3)
elseif room == "Room2" then
print("room two")
wait(3)
else
warn("Could not find this room.")
end
end
It gives the ‘room’ argument either Room1 or Room2 and it’s even confirmed when it prints it but for some reason the if statements don’t work? It prints the warning message.
Don’t understand the point behind it, still doesn’t work
print(player) prints the player name
print(room) prints Room1 or Room2
I don’t see what wrong.
This is actually weird I’m not sure if the room variable implemented within your code is a string. Try this instead.
function checkRoom(player, room)
print(room)
if tostring(room) == "Room1" then
print("room one")
wait(3)
elseif tostring(room) == "Room2" then
print("room two")
wait(3)
else
warn("Could not find this room.")
end
end