"player2.isValid" Doesn't Work/Isn't Needed

Description: Archive discussion
============================
Original description:
Official subforum for LunaLua - an extension framework for SMBX Engine Version 1.3 (which a core of SMBX 2.0). Share your creations that require the use of LunaLUA. You may also share info/tutorials on how to use LunaLUA.

Sambo M
Topic author, Count
Count
Avatar
Sambo M
Topic author, Count
Count
Age: 25
Reputation: 15
Posts: 264
Joined: 27 Jun 2014

Post #1by Sambo » 15 Apr 2015, 4:52

"player2.isValid" does not work for checking for a second player. In 1-player mode, it gives "attempt to index a nil value."
In 2-Player mode, it returns "true." This makes the code not useful for much of anything. However, the code isn't really necessary because you can simply use this:

Code: Select all

if (player2 ~= nil) then
 ...
end

instead of this:

Code: Select all

if (player2.isValid == true) then
 ...
end
Image
Current Project:
Image

Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest