Skip to content

error with "function {@title}name()" on start #2492

Closed
@Anarchick

Description

@Anarchick

Description

when the server start or after a /reload,
any function using "options" as :
function {@title}f():
will thrown an error and can't be used BUT after a /skript reload all, the function can be used without any error

Steps to Reproduce

use a server spigot or paper 1.14.4 with ONLY skript-2.4Beta7 or 2.4Beta8 with only 1 script .sk

options:
    title: test

on load:
    broadcast "{@title}"

function {@title}f():
    broadcast "<gold>function test"

start the server and look the warn on console.
test the function ( for exemple in chat or console write !testf() ) and it will not work cause the function is not loaded
do a /sk reload all and test the function, it work

Errors / Screenshots

[11:40:54] [Server thread/INFO]: CONSOLE: Reload complete.
[11:40:54] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 5788ms or 115 ticks behind
[11:40:54] [Server thread/INFO]: [Skript] Loading variables...
[11:40:54] [Server thread/INFO]: [Skript] Loaded 11417 variables in 0.1 seconds
[11:40:54] [Server thread/ERROR]: [Skript] undefined option {@title} (survival\test.sk, line 7: function {@title}f():')
[11:40:54] [Server thread/ERROR]: [Skript] Invalid function definition. Please check for typos and make sure that the function's name only contains letters and underscores. Refer to the documentation for more information. (survival\test.sk, line 7: function {@title}f():')
[11:40:54] [Server thread/INFO]: test
[11:40:54] [Server thread/INFO]: [Skript] Loaded 1 script with a total of 1 trigger and 0 commands in 0.19 seconds
[11:40:54] [Server thread/INFO]: [Skript] Finished loading.
>!testf()
[11:40:58] [Server thread/ERROR]: Error in: testf()
[11:40:58] [Server thread/ERROR]: The function 'testf' does not exist.
>sk reload all
[11:41:02] [Server thread/INFO]: [Skript] Reloading the config and all scripts...
>!testf()
[11:41:04] [Server thread/INFO]: Loaded 114161 aliases in 2288ms
[11:41:04] [Server thread/INFO]: test
[11:41:04] [Server thread/INFO]: All scripts loaded without errors.
[11:41:04] [Server thread/INFO]: Loaded 1 script with a total of 1 trigger and 0 commands in 0 seconds
[11:41:04] [Server thread/INFO]: [Skript] Successfully reloaded the config and all scripts.
[11:41:04] [Server thread/INFO]: executing 'testf()'
[11:41:04] [Server thread/INFO]: function test

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue that needs to be fixed. Alternatively, a PR fixing an issue.completedThe issue has been fully resolved and the change will be in the next Skript update.priority: mediumIssues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions