Megadeth9811 Posted June 23, 2015 Share Posted June 23, 2015 I want to make a script that tells you what "bone" you damage/break when you are in ragdoll mode and hit a body part at a certain force (i.e. the head). I plan on rigging separate "bone" model parts to the character skeleton (not possible yet), and making it render in the game so that it shows through the character model (longshot). How would I be able to start an action when the character damages a limb for starters? Example in Skate 3: I tried making a script (does nothing yet): local DethScript = {}function DethScript.unload()endfunction DethScript.init() local player = PLAYER.PLAYER_ID() local playerPed = PLAYER.PLAYER_PED_ID() local headBone = PED.GET_PED_BONE_INDEX(playerPed, 0x796e)endfunction DethScript.tick() local player = PLAYER.PLAYER_ID() local playerPed = PLAYER.PLAYER_PED_ID() --Head if ENTITY.HAS_ENTITY_COLLIDED_WITH_ANYTHING(headBone) and PED.IS_PED_RAGDOLL(playerPed) then --Show that my skull broke elseif (PED.IS_PED_RAGDOLL(playerPed)==false) then --Reset skullendend return DethScript Link to comment Share on other sites More sharing options...
davidp027 Posted June 23, 2015 Share Posted June 23, 2015 (edited) HAS_ENTITY_COLLIDED_WITH_ANYTHING(headBone) wont work as it needs an entity as a parameter, maybe this would work, not tested. Also I'm not a LUA coder so this might be wrong local player = PLAYER.PLAYER_ID() local playerPed = PLAYER.PLAYER_PED_ID() --Head if ENTITY.HAS_ENTITY_COLLIDED_WITH_ANYTHING(playerPed) and PED.IS_PED_RAGDOLL(playerPed) then local lastBone GET_PED_LAST_DAMAGE_BONE(playerPed, lastBone) if(lastBone == headBone) --Show that my skull broke end elseif (PED.IS_PED_RAGDOLL(playerPed)==false) then --Reset skullend Edited June 23, 2015 by davidp027 Link to comment Share on other sites More sharing options...
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