DanielZ3RO Posted January 23, 2014 Share Posted January 23, 2014 hello. I want to fix this error in the gore mod Link to comment
Anubhav Posted January 23, 2014 Share Posted January 23, 2014 Can you show your code of script or tell what is the problem in it? the faces? Link to comment
DanielZ3RO Posted January 23, 2014 Author Share Posted January 23, 2014 This is the script parts = { {2908,-90,-90,6}, --head {2907,-90,0,3}, --torso {2906,-90,-180,33}, --lA {2906,-90,0,23}, --rA {2905,-90,-90,42}, --lL {2905,-90,-90,52} --rL } koef = {[0]=1, [1]=1, [2]=2, [3]=2, [4]=2, [5]=2, [6]=2, [7]=2, [8]=2, [9]=2, [22]=3, [23]=3, [24]=3, [25]=5, [26]=5, [27]=5, [28]=4, [29]=4, [32]=4, [30]=4, [31]=4, [33]=5, [34]=5, [35]=7, [36]=7, [37]=0, [38]=7, [16]=7, [17]=0, [18]=0, [39]=6, [41]=0, [42]=0, [43]=0, [10]=1, [11]=1, [12]=1, [13]=1, [14]=1, [15]=1, [44]=0, [45]=0, [46]=0, [40]=0, [19]=7, [37]=0, [50]=8, [51]=7, [53]=0, [54]=0, [59]=7} function createBloodAtPos(theElement) local x,y,z = getElementPosition(theElement) for i=1,10 do setTimer(fxAddBlood,100+math.random(1,1000),1,x,y,z,0,0,3,10) end end function onRender() for i,v in ipairs(getElementsByType("object",getResourceRootElement(getThisResource()))) do if getElementData(v,"blood") == true then if math.random(1,100) == 1 then createBloodAtPos(v) end end end for i,v in ipairs(getElementsByType("sound",getResourceRootElement(getThisResource()))) do setSoundSpeed(v,getGameSpeed()) end end function onPlayerWasted(theKiller,theReason) setElementAlpha(source,0) math.randomseed(getTickCount()) math.random() math.random() math.random() local x,y,z = getElementPosition(source) local x2,y2,z2 if theKiller then x2,y2,z2 = getElementPosition(theKiller) else x2,y2,z2 = getElementPosition(source) x2 = x2 + math.random(-1,1) y2 = y2 + math.random(-1,1) z2 = z2 + math.random(-1,1) end local x1,y1,z1 = getElementPosition(getLocalPlayer()) --Sound play local theSound = playSound("sounds/hit"..tostring(math.random(1,6))..".wav") local dis = getDistanceBetweenPoints3D(x1,y1,z1,x,y,z) setSoundVolume(theSound,1/(dis/10)) setSoundSpeed(theSound,getGameSpeed()) --Meat creating for i,v in ipairs(parts) do local bX,bY,bZ = getPedBonePosition(source,v[4]) local thePart = createObject(v[1],x,y,z,v[2],0,getPedRotation(source)-v[3]) setElementCollisionsEnabled(thePart,false) setElementInterior(thePart,getElementInterior(source)) local oX = x-x2 local oY = y-y2 local vecLength = math.sqrt((oX * oX) + (oY * oY)) oX = oX/vecLength oY = oY/vecLength local k = 1 if theReason ~= 49 then if theReason then k = koef[theReason] end else local vX,vY,vZ = getElementVelocity(theKiller) local actualspeed = (vX^2 + vY^2 + vZ^2)^(0.5) k = actualspeed*20 end oX = x+(oX*k) oY = y+(oY*k) oX = oX + math.random(-1,1) oY = oY + math.random(-1,1) local oZ = getGroundPosition(oX,oY,z) local is,x3,y3,z3 = processLineOfSight(x,y,z,oX,oY,oZ,true,false,false,true,false) if is == true then oX = x3 oY = y3 oZ = z3 end moveObject(thePart,400/getGameSpeed(),oX,oY,oZ,math.random(360),math.random(360),math.random(360)) setTimer(destroyElement,2000,0,thePart) setElementData(thePart,"blood",true) end end function onSpawn() setElementAlpha(source,255) end addEventHandler("onClientPedWasted",getRootElement(),onPlayerWasted) addEventHandler("onClientPlayerWasted",getRootElement(),onPlayerWasted) addEventHandler("onClientPlayerSpawn",getRootElement(),onSpawn) addEventHandler("onClientRender",getRootElement(),onRender) Link to comment
DanielZ3RO Posted January 23, 2014 Author Share Posted January 23, 2014 This is the script parts = { {2908,-90,-90,6}, --head {2907,-90,0,3}, --torso {2906,-90,-180,33}, --lA {2906,-90,0,23}, --rA {2905,-90,-90,42}, --lL {2905,-90,-90,52} --rL } koef = {[0]=1, [1]=1, [2]=2, [3]=2, [4]=2, [5]=2, [6]=2, [7]=2, [8]=2, [9]=2, [22]=3, [23]=3, [24]=3, [25]=5, [26]=5, [27]=5, [28]=4, [29]=4, [32]=4, [30]=4, [31]=4, [33]=5, [34]=5, [35]=7, [36]=7, [37]=0, [38]=7, [16]=7, [17]=0, [18]=0, [39]=6, [41]=0, [42]=0, [43]=0, [10]=1, [11]=1, [12]=1, [13]=1, [14]=1, [15]=1, [44]=0, [45]=0, [46]=0, [40]=0, [19]=7, [37]=0, [50]=8, [51]=7, [53]=0, [54]=0, [59]=7} function createBloodAtPos(theElement) local x,y,z = getElementPosition(theElement) for i=1,10 do setTimer(fxAddBlood,100+math.random(1,1000),1,x,y,z,0,0,3,10) end end function onRender() for i,v in ipairs(getElementsByType("object",getResourceRootElement(getThisResource()))) do if getElementData(v,"blood") == true then if math.random(1,100) == 1 then createBloodAtPos(v) end end end for i,v in ipairs(getElementsByType("sound",getResourceRootElement(getThisResource()))) do setSoundSpeed(v,getGameSpeed()) end end function onPlayerWasted(theKiller,theReason) setElementAlpha(source,0) math.randomseed(getTickCount()) math.random() math.random() math.random() local x,y,z = getElementPosition(source) local x2,y2,z2 if theKiller then x2,y2,z2 = getElementPosition(theKiller) else x2,y2,z2 = getElementPosition(source) x2 = x2 + math.random(-1,1) y2 = y2 + math.random(-1,1) z2 = z2 + math.random(-1,1) end local x1,y1,z1 = getElementPosition(getLocalPlayer()) --Sound play local theSound = playSound("sounds/hit"..tostring(math.random(1,6))..".wav") local dis = getDistanceBetweenPoints3D(x1,y1,z1,x,y,z) setSoundVolume(theSound,1/(dis/10)) setSoundSpeed(theSound,getGameSpeed()) --Meat creating for i,v in ipairs(parts) do local bX,bY,bZ = getPedBonePosition(source,v[4]) local thePart = createObject(v[1],x,y,z,v[2],0,getPedRotation(source)-v[3]) setElementCollisionsEnabled(thePart,false) setElementInterior(thePart,getElementInterior(source)) local oX = x-x2 local oY = y-y2 local vecLength = math.sqrt((oX * oX) + (oY * oY)) oX = oX/vecLength oY = oY/vecLength local k = 1 if theReason ~= 49 then if theReason then k = koef[theReason] end else local vX,vY,vZ = getElementVelocity(theKiller) local actualspeed = (vX^2 + vY^2 + vZ^2)^(0.5) k = actualspeed*20 end oX = x+(oX*k) oY = y+(oY*k) oX = oX + math.random(-1,1) oY = oY + math.random(-1,1) local oZ = getGroundPosition(oX,oY,z) local is,x3,y3,z3 = processLineOfSight(x,y,z,oX,oY,oZ,true,false,false,true,false) if is == true then oX = x3 oY = y3 oZ = z3 end moveObject(thePart,400/getGameSpeed(),oX,oY,oZ,math.random(360),math.random(360),math.random(360)) setTimer(destroyElement,2000,0,thePart) setElementData(thePart,"blood",true) end end function onSpawn() setElementAlpha(source,255) end addEventHandler("onClientPedWasted",getRootElement(),onPlayerWasted) addEventHandler("onClientPlayerWasted",getRootElement(),onPlayerWasted) addEventHandler("onClientPlayerSpawn",getRootElement(),onSpawn) addEventHandler("onClientRender",getRootElement(),onRender) Link to comment
Anubhav Posted January 23, 2014 Share Posted January 23, 2014 Ok, But whats the problem in it?> i dint understood that 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