capitanazop Posted October 28, 2008 Posted October 28, 2008 hi, when i wanna create a object system when you touch a the object in movement you loose hp. what function i need? i search but i dont find any function like OnplayerTouchObject. bye n sorry for ma english |||||||||||||||||||||DanieloX|||||||||||||||||||||||
50p Posted October 29, 2008 Posted October 29, 2008 http://development.mtasa.com/index.php? ... yerContact - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
robhol Posted October 29, 2008 Posted October 29, 2008 http://development.mtasa.com/index.php?title=OnPlayerContact AFAIK this only triggers when the player actually jumps onto an element, not just touching it or colliding with it. Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
50p Posted October 29, 2008 Posted October 29, 2008 http://development.mtasa.com/index.php?title=OnPlayerContact AFAIK this only triggers when the player actually jumps onto an element, not just touching it or colliding with it. That's what he wants... Or maybe he wants an event that is triggered on ever server pulse? There isn't such event and won't be... That's why we have onClientRender. You can add some data to player (setElementData) that says you are touching object, then you can check (getElementData) if he's touching object in both server-side and client-side scripts. But from what I understand he wants to take away players' hp when touch (contact) with object. If you want to make an object be like a "fire ground" that if you walk on it your hp goes down, you should use timers (server-side) or onClientRender (client-side). - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
robhol Posted October 29, 2008 Posted October 29, 2008 IT sounds like he wants to make a moving object that knocks some HP off ya, but.. it's not really too well explained. Can you clarify a bit, cap? Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
capitanazop Posted October 31, 2008 Author Posted October 31, 2008 i wanna a object whit move and if this touch you loose hp. |||||||||||||||||||||DanieloX|||||||||||||||||||||||
aralmo Posted October 31, 2008 Posted October 31, 2008 I think you can do it with something like that on clientSide using the onClientRender event. local sphere = createColSphere( posX, posY, posZ, radius ) local closePlayers = getElementsWithinColShape( sphere, "player" ) The sphere should be the collision area of the damaging object, and the closePlayers are the players currently hitting it.
robhol Posted October 31, 2008 Posted October 31, 2008 I think you can do it with something like that on clientSide using the onClientRender event. local sphere = createColSphere( posX, posY, posZ, radius ) local closePlayers = getElementsWithinColShape( sphere, "player" ) The sphere should be the collision area of the damaging object, and the closePlayers are the players currently hitting it. Not exactly a good idea, because if players stay in the colshape, they'd keep being raped. Better to use an event. Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
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