Jump to content

Mirou123

Members
  • Posts

    7
  • Joined

  • Last visited

Mirou123's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. I will try Gallardo's script first.I hope I won't need to PM and bother you.Thank you everyone edit: After a few changes I got the script to work.Thank you so much
  2. Yeah I did.But I think maybe I am doing something wrong when calling the function? this is what I did addCommandHandler("door",IsNearDoor)
  3. Thanks,But it's not working it doesn't show any errors nor do anything IG
  4. I want to compare each position in that table with the player's position then outputs the position or anything of the closest door
  5. Thanks but how can I loop through them?
  6. Hi.What I want to do is a bit more complicated but to show you what I need help with I will use a simple example. Iwant to create a few objects around the town for example doors.I want a command that will loops through all the doors and only the doors and set an ID for each one of them.then tell me if I am close to any of them and the ID of that door.(I am asking for an ID because I want to setCameraMatrix(doorx,doory,doorz,playerx,playery,playerz,) if you know an easier way tell me please. function IsNearDoor(player) local x,y,z = getElementPosition(getLocalPlayer ( )) local doorx,doory,doorz = "Idk what to do here" local distance = getDistanceBetweenPoints3D(x,y,z,doorx,doory,doorz) if distance < 5 then outputChatBox ("There is a door near you!") setCameraMatrix("The coords of that door",x,y,z) end end Thank you in advance
  7. 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
×
×
  • Create New...