stumpy Posted March 27, 2014 Share Posted March 27, 2014 Hello, is there any way to make a synced Ball? I´ve tried to sync the beachball (ID: 1598) but on getElementPostition(beachball), i got the spankoords back, not the actuelly postition. Or ist there any other way to make a synced ball, maybe like the Neon Carball Script? Regards Link to comment
WhoAmI Posted March 27, 2014 Share Posted March 27, 2014 Maybe you have to user moveObject Link to comment
Spajk Posted March 27, 2014 Share Posted March 27, 2014 Did you get the element position server-side or client-side? Link to comment
stumpy Posted March 28, 2014 Author Share Posted March 28, 2014 i´ve tried both, but it´s on client and server the same. Now i tried to make this with moveObject, but i don´t know how i get the direction for movement. This is my example, maybe anybody can help me with this function. function onDozerCollision(hit,force,bodyPart,colX,colY,colZ,normX,normY,normZ,hitForce,model) if getElementModel(hit) == 1598 then local x,y,z = getElementPosition(hit) moveObject(hit,5000,x,y,z,0,0,0,"OutQuad") end end addEventHandler("onClientVehicleCollision", getRootElement(),onDozerCollision) Link to comment
WhoAmI Posted March 28, 2014 Share Posted March 28, 2014 If you use function clientside it would be shown only for 1 player - localPlayer. Link to comment
stumpy Posted March 28, 2014 Author Share Posted March 28, 2014 yes i know, but i can trigger the moveObject Function to server. For example: Client: function onDozerCollision(hit,force,bodyPart,colX,colY,colZ,normX,normY,normZ,hitForce,model) if getElementModel(hit) == 1598 then local x,y,z = getElementPosition(hit) triggerServerEvent("moveBall_S",getLocalPlayer(),hit,x,y,t) end end addEventHandler("onClientVehicleCollision", getRootElement(),onDozerCollision) Server: function moveBall_S_func(ball,x,y,z) moveObject(ball,5000,x,y,z,0,0,0,"OutQuad") end addEvent("moveBall_S",true) addEventHandler("moveBall_S",getRootElement(),moveBall_S_func) But i´ve problems with the calculation of the movement direction. Thanks for your help! Link to comment
cheez3d Posted March 28, 2014 Share Posted March 28, 2014 findRotation() getElementVelocity() setElementVelocity() Link to comment
stumpy Posted March 28, 2014 Author Share Posted March 28, 2014 Yes i know the needed functions. But i´ve problems with the calculation. I´m not a math pro. Can anybody help me with this issue? Link to comment
Jusonex Posted March 28, 2014 Share Posted March 28, 2014 As far as I know Neon Carball uses an invisible car that has the same size as the ball (so that the ball seems to have its own physics which you can modify via setModelHandling/setVehicleHandling). As an alternative you can try to play around with setObjectMass and dynamic objects. Everything else (setElementVelocity etc.) would require pretty much efford. Link to comment
stumpy Posted March 28, 2014 Author Share Posted March 28, 2014 Oh that´s a pretty nice idea! I will try it! Thank you Jusonex! Is there any way to remove the shadow from the vehicle? It´s also shown at vehicle alpha 0. Regards Link to comment
Karuzo Posted March 28, 2014 Share Posted March 28, 2014 idk but you could replace that car texture? but im not sure. 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