Disableing Buttons?

Need help with any SMBX game-related issues? Ask your questions here.

Moderator: Userbase Moderators

_SleepyWhirl_
Bob-Omb
Bob-Omb
Posts: 23
Joined: Thu Aug 19, 2021 9:52 pm
Flair: Discord: SleepyWhirl#6093
Pronouns: he/him
Contact:

Disableing Buttons?

Postby _SleepyWhirl_ » Sat Oct 02, 2021 12:29 am

i have another quick question, is it possible to disable serten buttons from working in game? such as jumping or running? i was wondering because i am working on sort of a horror thingy at the moment and i want to limit the amount of movement the character should have to make it a bit more thrilling
how would i go about doing this if it is possible?

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 547
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: Disabling Buttons?

Postby Marioman2007 » Sat Oct 02, 2021 3:02 am

_SleepyWhirl_ wrote:
Sat Oct 02, 2021 12:29 am
i have another quick question, is it possible to disable serten buttons from working in game? such as jumping or running? i was wondering because i am working on sort of a horror thingy at the moment and i want to limit the amount of movement the character should have to make it a bit more thrilling
how would i go about doing this if it is possible?

Code: Select all

function onTick()
    player.keys.down = false
    player.keys.up = false
    player.keys.right = false
    player.keys.left = false
    player.keys.run = false
    player.keys.jump = false
    player.keys.altRun = false
    player.keys.altJump = false
end
remove the lines here as your convenience
OR to disable ALL the keys then simply:

Code: Select all

function onTick()
    for k,v in pairs(player.keys) do
        player.keys[k] = false
    end
end


Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari