Is it possible to have a character with two abilities, one of them being a swim that only works underwater? I'm unable to get it working with my limited lua knowledge despite trying.
CA_SWIM doesn't have an ability for above-ground use.
that being said though, you can perfectly well change a skin's ability depending on the context. using the (player prefix).ability userdata, you can change it to whatever value you want using lua. i won't write the code for you, you'll definitely want to look at a tutorial + the wiki's extensive but slightly unfinished lua documentation.
You can change the player's ability when checking if the player is underwater or not.
There is a player flag for being underwater, and the player structure stores the player's current ability in the charability player variable.
addHook("ThinkFrame", function()
for player in players.iterate do
if player.mo.skin ~= "mechatails" then
continue
end
if (player.mo.eflags & MFE_UNDERWATER) then
player.charability = CA_SWIM
else
player.charability = CA_NONE
end
end
end)
replace mechatails with the desired skin name and "CA_NONE" with your desired land ability.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.