Skip to content

Wait in if statement branch causes the other branch to be delayed #8139

@softy-oniguru

Description

@softy-oniguru

Skript/Server Version

[17:09:31 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[17:09:31 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[17:09:31 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[17:09:31 INFO]: [Skript] Server Version: 1.21.8-81-55de442 (MC: 1.21.8)
[17:09:31 INFO]: [Skript] Skript Version: 2.12.1 (skriptlang-github)
[17:09:31 INFO]: [Skript] Installed Skript Addons: 
[17:09:31 INFO]: [Skript]  - skript-reflect v2.6 (https://github.com/SkriptLang/skript-reflect)
[17:09:31 INFO]: [Skript]  - skript-placeholders v1.7.0 (https://github.com/APickledWalrus/skript-placeholders)
[17:09:31 INFO]: [Skript] Installed dependencies: None

Bug Description

syntax errors after conditions

Expected Behavior

parsing errors

Steps to Reproduce

on damage:
  if {boosters::*} contains attacker:
    if attacker has cooldown for attacker's tool:
      cancel event
      stop
    set damage to damage * 2
    wait tick
    set attacker's cooldown for attacker's tool to 5 second
  else:
    set damage to 0 # can't be used after wait
function teleporttosky(p: player) :: boolean:
  loop 15 times:
    teleport {_p} to location 5 blocks above {_p}
    return true # can be used only in functions?
  return false # can be used only in functions?

Errors or Screenshots

[17:25:03 INFO]: [Skript] Reloading test.sk...
[17:25:03 INFO]: Line 15: (test.sk)
[17:25:03 INFO]: The return effect can only be used in functions, custom expressions, sections, custom syntax parse sections and custom conditions
[17:25:03 INFO]: Line: return true# can be used only in functions, ...?
[17:25:03 INFO]:
[17:25:03 INFO]: Line 16: (test.sk)
[17:25:03 INFO]: The return effect can only be used in functions, custom expressions, sections, custom syntax parse sections and custom conditions
[17:25:03 INFO]: Line: return false# can be used only in functions, ...?
[17:25:03 INFO]:
[17:25:03 INFO]: Line 10: (test.sk)
[17:25:03 INFO]: Can't change the damage anymore after the event has already passed
[17:25:03 INFO]: Line: set damage to 0# can't be used after wait
[17:25:03 INFO]:
[17:25:03 INFO]: Encountered 3 errors while reloading test.sk! (41ms)

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.

Metadata

Metadata

Labels

PR availableIssues which have a yet-to-be merged PR resolving itbugAn issue that needs to be fixed. Alternatively, a PR fixing an issue.priority: lowIssues that are not harmful to the experience but are related to useful changes or additions.

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions