Hey there! I'm new to love2d, and I would like to find out how to check if a file exists. I checked the wiki but it was a bit confusing.
[Slight information:
You need a password to play my game, and I made it so it adds a file that stores the password if its correct, how do I check if this file exists or not when entering the password. ]
How to check for a file
- BrotSagtMist
- Party member
- Posts: 661
- Joined: Fri Aug 06, 2021 10:30 pm
Re: How to check for a file
Code: Select all
password=love.filesystem.read("file" )
if password then
rungame()
else
nopassword()
end
obey
Re: How to check for a file
Thanks!BrotSagtMist wrote: ↑Thu Dec 01, 2022 10:11 pmCode: Select all
password=love.filesystem.read("file" ) if password then rungame() else nopassword() end
Who is online
Users browsing this forum: No registered users and 2 guests