Rinart73 Posted August 15, 2019 Share Posted August 15, 2019 Avorion: 0.25.2 Windows 10 x64 I have a script "data/scripts/player/gatefounder.lua" that is attached to a Player object. When I look at the Player object in a dev-mode debug window, I see that for some reason it has following path: "data\scripts\player\gatefounder.lua". Some scripts have forward slashes in their path and some - backwards. I'm trying to execute following code on sever side: print(player:hasScript("data/scripts/player/gatefounder.lua")) -- returns 1, so script is attached local status, success = player:invokeFunction("data/scripts/player/gatefounder.lua", "found", tx, ty, "confirm") So I should get 0 as my 'status' (according to the Docs) and function return value as my `success`. But 'status' is 3, which means that "the given script was not found in the entity". But it is attached to the object. Then I try to use: local status, success = player:invokeFunction("data\\scripts\\player\\gatefounder.lua", "found", tx, ty, "confirm") And everything works just fine. Please either fix "invokeFunction" or make sure that Avorion transforms all paths to have forward slashes. Because currently I have to invoke function 2 times each time. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now