Page 1 of 1

SMBX 1.4.5: Script mistake?

Posted: 24 Nov 2019, 6:07
by Kinopiokuppa
bandicam 2019-11-24 12-02-18-143.mp4 (4.75 MiB) Viewed 329 times

Script:
Score.txt
(249 Bytes) Downloaded 253 times

Posted: 24 Nov 2019, 7:30
by Lx Xzit
For the next time, if you need help with scripts you can go to smbx38a discord server or post at TeaScript subforum. Please use this subforum exclusively for reporting game bugs.

About your code, I see a lot of problems with it.
First, it won't work because you're subtracting ten seconds, so unless you've got the perfect timing (getting the flagpole at a multiplier by ten) it will never take the value of zero. The line "if lvlTimer(Count)=0 then" won't do anything at all since you didn't put instructions inside that block.
Lastly, it won't stop players completely. I don't know why you wanted the player to be still, so my guess is that you only wanted to limit it's walking speed? Anyway, that's not the right way to do it.

I fixed your code:

Code: Select all

do
    if lvltimer(count) > 0 then
        call tcreate([SOUND]Endsound, 0)
        lvltimer(count)-=10
        sysval(score)+=500
        if char(1).xsp > 2 then
            char(1).xsp = 2
        else
            exit do
        end if
        if char(2).xsp > 2 then
            char(2).xsp = 2
        else
            exit do
        end if
    else
        lvltimer(count) = 0
    end if
    call sleep(1)
loop

Posted: 24 Nov 2019, 10:41
by Kinopiokuppa
thank you for your answer.
The score only increased by 500.