Sign in to follow this  
WezzarD

setPlayerPosition

Recommended Posts

I was creating a new game mode after I do all GUI I did this script 

Quote

addEventHandler("onClientGUIClick",root,
function ()
if source == ENTER1 then    
    setElementPosition ( source, 1549.88953, -1685, 13 ) 
end 
end
)

 

but when I click on "ENTER1" key it didn't respond.

Share this post


Link to post

try this

addEventHandler("onClientGUIClick",root,
function ()
if source == ENTER1 then    
    setElementPosition ( localPlayer, 1549.88953, -1685, 13 ) 
end 
end
)

 

Share this post


Link to post
addEventHandler("onClientGUIClick",ENTER1,
function()  
  setElementPosition(localPlayer,1549.88953,-1685,13) 
end
)

If you use source on "onClientGUIClick" it does get the gui element not the player so use always localPlayer on client-side scripts to get the player.

Edited by ÆBKV

Share this post


Link to post

Call it on server side if you call in client it wont sync dimension or interior

Edited by URBAN

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.