Why don't any of my skin checks work

NeonSRB2

Member
Welp lets be upfront about it, this is the only line in the code to check for skin, and it says I'm doing arithmetic operations on it.


Code:
if (p.powers[pw_super] & p.mo.skin == "metalsonic") then
This is lua as well, I tried skin checking in many scripts beforehand, and they always don't work.
 
Last edited:
I'm just a Lua amateur, but you need to rewrite the code like this, because that is an arithmetic operation:
Code:
if player.powers[pw_super] and player.mo.skin == "metalsonic" then
 
I'm just a Lua amateur, but you need to rewrite the code like this, because that is an arithmetic operation:
Code:
if player.powers[pw_super] and player.mo.skin == "metalsonic" then


Hmmm, ill try it, doesn't seem too much different but i'll give it a go ahead

---------- Post added at 09:02 AM ---------- Previous post was at 09:01 AM ----------

Oh wait, the and is in there, I guess the symbol is for bitwise operations only.

---------- Post added at 09:03 AM ---------- Previous post was at 09:02 AM ----------

Thanks man, gonna try to put you as a contributor

---------- Post added at 09:05 AM ---------- Previous post was at 09:03 AM ----------

Also p was the player var, it's customizable to each function
 
Yeah, singular & is bitwise. In most other scripting languages, && is the equivalent of and, however blua doesn't appear to support this.
 
Well the submission is up, ill do a test game with metal force skin and super run.


Also the only person joining is my brother because my network stuff is hot garbage and only hosts srb2 servers on lan
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top