Jump to content

What's wrong with my code?


Mirou123

Recommended Posts

Hello I'm new in LUA I tryed to create this small script I want it to change the camera's look at position

function SetCameraLookAt() 
                local screenx, screeny, worldx, worldy, worldz = getCursorPosition() 
                local cx,cy,cz,clx,xly,clz = GetCameraMatrix(playerid) 
                SetCameraMatrix(cx ,cy ,cz ,worldx, worldy, worldz) 
        end 
end 
  
addEventHandler( "onClientCursorMove", getRootElement( ),SetCameraLookAt) 

I can't see what's wrong with this code I hope you can help oh by the way in the code before this one I set the camera's position to a location using SetCameraMatrix and I used showCursor.One last thing,this is a client side script

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...