Skript

Skript

743k Downloads

global function already exists in the very same file

EysseW opened this issue ยท 10 comments

commented

Skript/Server Version

[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript] Server Version: 1.21.1-118-fb76840 (MC: 1.21.1)
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript] Skript Version: 2.9.0 (skriptlang-github)
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript] Installed Skript Addons: 
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript]  - skript-gui v1.3 (https://github.com/APickledWalrus/skript-gui)
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript]  - Skellett v2.0.9 (https://forums.skunity.com/resources/skellett.24/)
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript]  - MorkazSk v1.4
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript]  - skript-db v1.3.9
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript]  - SkQuery v4.1.10
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript]  - SkBee v3.5.6 (https://github.com/ShaneBeee/SkBee)
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript]  - PotatoSK v1.0.1 (https://github.com/MCdragonmasters/PotatoSK)
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript] Installed dependencies: 
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript]  - Vault v1.7.3-b131
[17:48:08] [Render thread/INFO]: [System] [CHAT] [Skript]  - WorldGuard v7.0.9+5934e49

Bug Description

when I reload my script, it gives this error for all my functions:
Line 45: (main.sk) A global function named 'check_startgame_v1' already exists in script 'main.sk' Line: function check_startgame_v1():

I have tried deleting my entire plugins/Skript/ directory, only copying the scripts over, I have tried running /sk reload all, /sk reload scripts, and I have tried restarting the server multiple times. Also tried renamed the functions and the files themselves. Nothing works. I encountered this problem on 2.9.0, the error log from which is attached, but I also tried this on 2.9.3, same error. In fact, in was only when I updated my server to 1.21 and updated skript to 2.9.3 that I had this issue.

Expected Behavior

reloads the entire file without giving an error

Steps to Reproduce

Reloading any script in in skript 2.9.x

Errors or Screenshots

image

Other

No response

Agreement

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

Cannot reproduce on 2.9.3

Usually when that happens a quick server restart fixes it. If it still happens after a server restart you might wanna double check the code.

If it happens after a restart can you send the main.sk file?

Also try avoiding commands like sk reload all and sk reload scripts unless you absolutely need to reload everything.

commented

I loaded that file on my test server and I got lots of errors (due to missing addons) but none of them were related to functions already existing

commented

I tried restarting. Main.sk:
https://file.io/Q31zkd3sfPQ2

commented

Weird. What could be the cause? Is there something wrong with cache files on my system?

commented

It could be due to outdated addons, possibly.

commented

had the same issue, it only happens when you reload the same file the second time (when there is a syntax error in the function), the first time will have no errors (even if there is a syntax error in the function).
Error log: https://pastebin.com/00YhFGuh
Minecraft log 2024-10-07_00 27 57
Reproduction code:

function errorTest():
  give 1 of diamond to the player  #no player in a function, however, no error will be shown
command testErrorCMD:
  trigger:
    errorTest()
commented

@denloself what is your /sk info?

commented

@denloself using the code you sent I am getting there is no player in a function event error. I think your issue is skellett.

commented

yes i do think so now, im sorry that i mistakenly thought they would be the same issue, i was also talking to them on discord and it seems like they had the issue caused by another plugin

commented

My issue seems to have come from the very much outdated TusKe I was still using.