Jump to content

Exports problem


Hero192

Recommended Posts

Hey guys ,

I want to do an exports for Cursor, i want it be like that

exports.Mouse:mouse(false) replace the showCursor(false) because i use the resource Mouse and if i want to cancel the mouse i need to do an exports it doesn't cancel it with showCursor i already tried that.

--Mouse script for export: (I already added the function exports to meta, problem is on the script i tried this way but doesn't works , please give me a hand if you know..

function enablemouse (key, keyState) 
 if(isCursorShowing()) then 
 showCursor(false) 
   end 
end 
  
 function mouse () 
    return enablemouse 
end 

Link to comment
What exactly is the problem here?

showCursor is resource based, if you use showCursor in a certain resource you have to hide it from the same resource.

When i use the Cursor from this resource i binded it in a key, for example if i want to hide the cursor after clicking on the button it doesn't works i have to exports the cursor from the Cursor file, so please just helps me to exports it because i don't know how and i know what am i talking about..

Link to comment

Client for Mouse resource:

function setMouseState(state) 
    showCursor(state) 
end 

export in the meta:

function="setMouseState" type="client"/> 

 

Usage:

exports.Mouse:setMouseState(true) -- to show the mouse 
exports.Mouse:setMouseState(false) -- to hide the mouse 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...