Maccer. Posted March 10, 2010 Share Posted March 10, 2010 Okay, I'd be so freaking greatful if somebody could assist me in some math, I mean REALLY greatful. Here's the situation: I need a math function that will calculate the attachElements offsets for a 3.D position in space. This however, might need adjusting in GTA. If somebody could get this, I would really love them. attachElements(element, anotherElement, get3dPointToOffsets(x, y, z)) Link to comment
Maccer. Posted March 10, 2010 Author Share Posted March 10, 2010 Okay, this was figured out, however, I based my code off the default briefcase script. local x, y, z = getPedBonePosition(v.player, 25) local rx, ry, rz = getElementRotation(v.player) local xOffset = .1 * math.cos(math.rad(rz)) local yOffset = .1 * math.sin(math.rad(rz)) setElementPosition(v.briefcase, x+xOffset, y+yOffset, z) setElementRotation(v.briefcase, rx, ry, rz+rotationOffset) I'm having problems adjusting my x, y, z coordinates so it fits. What I'm trying to do: Make a player carry a box, similar to the burglar script. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now