Rinart73 Posted April 5, 2017 Share Posted April 5, 2017 When I'm trying to do something like this in script that I attached earlier: -- MyScript function initialize() local entity = Entity() if someCondition then entity:removeScript(pathToMyScript) end end server just crashes with error "EXCEPTION_ACCESS_VIOLATION". So.. how to removeScript from itself? Link to comment Share on other sites More sharing options...
w00zla Posted April 5, 2017 Share Posted April 5, 2017 When I'm trying to do something like this in script that I attached earlier: -- MyScript function initialize() local entity = Entity() if someCondition then entity:removeScript(pathToMyScript) end end server just crashes with error "EXCEPTION_ACCESS_VIOLATION". So.. how to removeScript from itself? just use terminate() instead ... it sets the script to invalid and removes it automagically on the next ocassion! Link to comment Share on other sites More sharing options...
Rinart73 Posted April 5, 2017 Author Share Posted April 5, 2017 Thanks, I just found it myself in the API Reference :) (I probably shouldn't create so many threads..) Link to comment Share on other sites More sharing options...
darkconsole Posted April 5, 2017 Share Posted April 5, 2017 i ran into this crash too when i was trying to be crafty and have a script reload its own source lol. 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