Jump to content

no idea..


prolol

Recommended Posts

hai, i'm kinda new, but

i got this simple script to activate the cursor, but it doesn't seem to work, can anyone help me?

here the script:

addEventHandler ( "onResourceLoad", getRootElement(), "loadScripts" )
 
function loadScripts
for index, player in getElementsByType ( "player" ) do
	bindKey ( player, "p"down", "hookCursor" )
end
end
 
addEventHandler ( "onPlaterJoin", getRootElement(), "handleSingleJoin" )
 
function handleSingleJoin
bindKey( source, "p" "down", "hookCursor" )
end
 
function hookCursor
   if isCursorShowing ( source ) then
       showCursor ( source, false )
   else					
       showCursor ( source, true )
   end	
end

and

here is the meta.xml:

- <meta>
 <info src="test.lua" type="client" version="1.0.0" /> 
 </meta>]

Link to comment

There are lot of syntax mistakes:

Lines 3, 11, 15: missed "( )" after function name

Line 4: should be

for index, player in [color=#FF0000]pairs[/color]( getElementsByType ( "player" ) ) do

Line 5:

bindKey ( player, "p[color=#FF0000]", "[/color]down", "hookCursor" )

Line 9:

"onPla[color=#FF0000]y[/color]erJoin"

Line 12:

bindKey( source, "p"[color=#FF0000],[/color]"down", "hookCursor" )

Finally, this script can't be client-side, all the functions and events you're using are for server-side scripts.

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