Perfect Posted December 31, 2012 Share Posted December 31, 2012 Hi All, Today i am thinking of can we use local function in 2 resources, if we made that local in 1 resouce ? Ex:- If i made something like this local player = getLocalPlayer() in 1 resource and i want to use that function in another resource without writing that (local player = getLocalPlayer()) again ? I know somehow that is possible but i don't know how. which functions should i use to make that possible ? (btw for the title i didn't get what to wrote, sorry) Link to comment
Jaysds1 Posted December 31, 2012 Share Posted December 31, 2012 ummm, you could export the function so any resource could use it, but you would need to call it using the call function, or using this little script: exports.resourceName.functionName() . Link to comment
Perfect Posted December 31, 2012 Author Share Posted December 31, 2012 ummm, you could export the function so any resource could use it, but you would need to call it using the call function, or using this little script: exports.resourceName.functionName() . hm, that is nice but i don't mean that. i mean if make local player = getLocalPlayer() function then i don't want to call it, retype it, etc... I want to use that (local player = getLocalPlayer()) function like we use getLocalPlayer(). again is it possible ? Link to comment
Jaysds1 Posted December 31, 2012 Share Posted December 31, 2012 I don't think it's possible. Link to comment
Perfect Posted December 31, 2012 Author Share Posted December 31, 2012 I don't think it's possible. can we do something like local player = getLocalPlayer() and enable that function in all resources ? (when this resource start, its enable. when stop, not.) Link to comment
Jaysds1 Posted December 31, 2012 Share Posted December 31, 2012 ah, I really don't think variables could be transported, I know that variables can transfer with in the resource (script to script) depending on the sides(server/client). Link to comment
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