Skip to content

Issue with onclick { } #205

@DiamondNether90

Description

@DiamondNether90
onclick {
    score += 1;
}

I have the following code that is intended to increment a global score variable when the sprite is clicked. However, this has extremely buggy behaviour when imported. The code shown in the scratch editor is correct when the .sb3 file is imported, but a click increments score by 2. When leaving and reentering the sprite, the script duplicates and each click increments score by 3.

I have no idea what is happening here, but it is preventing me from using goboscript at this time. I am happy to provide more details if need-be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions