DRW Posted July 15, 2015 Posted July 15, 2015 Hello, in this script I've created some objects, but these don't have any collision, why? SERVER mines={} mines[1]={316.623046875, 2310.3662109375, 175.88377380371} mines[2]={368.55038452148, 2279.5004882812, 179.28540039062} mines[3]={371.35195922852, 2383.2370605469, 204.61744689941} mines[4]={322.07421875, 2455.6181640625, 209.29032897949} mines[5]={459.70449829102, 2427.0690917969, 191.66717529297} mines[6]={534.01818847656, 2469.5270996094, 183.58447265625} mines[7]={ 635.9619140625, 2403.568359375, 180.75654602051} mines[8]={629.318359375, 2513.05859375, 166.53332519531} mines[9]={ 757.48828125, 2565.681640625, 159.08197021484} mines[10]={881.20446777344, 2574.3151855469, 160.68569946289} mines[11]={778.15057373047, 2687.6740722656, 155.58869934082} mines[12]={958.9248046875, 2667.8623046875, 157.94715881348} mines[13]={912.7998046875, 2766.8828125, 182.83726501465} mines[14]={821.197265625, 2795.1171875, 166.05780029297} mines[15]={822.2978515625, 2455.7451171875, 140.25344848633} objects = {} marke = {} function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset) mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or "checkpoint", size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0 assert(isElement(element), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got " .. type(element) .. "]") assert(type(mType) == "string", "Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got " .. type(mType) .. "]") assert(type(size) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got " .. type(size) .. "]") assert(type(r) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got " .. type(r) .. "]") assert(type(g) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got " .. type(g) .. "]") assert(type(b) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got " .. type(b) .. "]") assert(type(a) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got " .. type(a) .. "]") assert(isElement(visibleTo), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got " .. type(visibleTo) .. "]") assert(type(xOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got " .. type(xOffset) .. "]") assert(type(yOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got " .. type(yOffset) .. "]") assert(type(zOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got " .. type(zOffset) .. "]") local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo) if m then if attachElements(m, element) then return m end end return false end addEvent ("objs",true) addEventHandler ("objs",getRootElement(),function() for i,v in ipairs(mines) do yx,yy,yz=unpack(v) objects[i] = createObject (3929,yx,yy,yz) setElementData (objects[i],"mineununtrium","true") setElementData(objects[i],"qununtrium",5) marke[i] = createMarkerAttachedTo (objects[i],"corona",4,255,255,255,50,getRootElement(),0,0,10) end end) addEvent ("give1",true) addEventHandler ("give1",getRootElement(),function() local uut = getElementData (source,"ununtrium") for i=1, #mines do destroyElement(objects[i]) destroyElement (marke[i]) objects[i] = nil marke[i] = nil setElementData (source,"ununtrium",uut+3) end end) addEvent ("give1",true) addEventHandler ("give1",getRootElement(),function() local uut = getElementData (source,"ununtrium") destroyElement (marke) setElementData (source,"ununtrium",uut+3) end) addEventHandler ("onPlayerLogin",getRootElement(),function() if not getAccountData (getPlayerAccount(source),"primera3") then setAccountData (getPlayerAccount(source), "ununtrium",0) setAccountData (getPlayerAccount(source), "ununquadium",0) setAccountData (getPlayerAccount(source), "ununpentium",0) setAccountData (getPlayerAccount(source), "ununhexium",0) setAccountData (getPlayerAccount(source), "ununseptium",0) setAccountData (getPlayerAccount(source), "ununoctium",0) setElementData (source, "ununtrium", 0) setElementData (source, "ununquadium", 0) setElementData (source, "ununpentium", 0) setElementData (source, "ununhexium", 0) setElementData (source, "ununseptium", 0) setElementData (source, "ununoctium", 0) setAccountData (getPlayerAccount(source),"primera3","true") else setElementData (source, "ununtrium", getAccountData (getPlayerAccount(source), "ununtrium")) setElementData (source, "ununquadium", getAccountData (getPlayerAccount(source), "ununquadium")) setElementData (source, "ununpentium", getAccountData (getPlayerAccount(source), "ununpentium")) setElementData (source, "ununhexium",getAccountData (getPlayerAccount(source), "ununhexium")) setElementData (source, "ununseptium",getAccountData (getPlayerAccount(source), "ununseptium")) setElementData (source, "ununoctium", getAccountData (getPlayerAccount(source), "ununoctium")) end end) addEventHandler ("onResourceStart",getResourceRootElement(getThisResource()),function() triggerEvent ("objs",source) end) CLIENT addEventHandler ("onClientObjectDamage", getRootElement(), function(loss,attacker) Zx,Zy,Zz= getElementPosition (source) weapons = getPedWeapon (localPlayer) if weapons == 5 and getElementData (source,"mineununtrium") then local uutt = getElementData (source,"qununtrium") setElementData (source,"qununtrium",uutt-1) if getElementData(source,"qununtrium") == 0 then triggerServerEvent ("give1",attacker) local sound1 = playSound3D ("sonido/roto.wav",Zx,Zy,Zz,false) outputChatBox ("#666666You have extracted #ffffff3 #666666units of #ffffffUnuntrium",255,255,255,true) end else cancelEvent() end end) Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
DRW Posted July 15, 2015 Author Posted July 15, 2015 Use setElementCollisionsEnabled Used it, no collisions either. Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
GTX Posted July 15, 2015 Posted July 15, 2015 They do have collisions. We can't help you there. http://prntscr.com/7t69vn Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
DRW Posted July 15, 2015 Author Posted July 15, 2015 They do have collisions. We can't help you there. http://prntscr.com/7t69vn Dammit, thank you, at least now I know that it's a not problem of the script May the problem be caused by Map Editor? Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
DRW Posted July 16, 2015 Author Posted July 16, 2015 They do have collisions. We can't help you there. http://prntscr.com/7t69vn Sorry for bothering you again, but it has collisions until I restart the script many times... Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
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