SoManyTears Posted December 31, 2020 Posted December 31, 2020 these codes I wrote do drop fps every 10 seconds.How can I use the setlementCollidableWith function properly? please help friends. setTimer (function() for i,peds in ipairs (getElementsByType ("ped")) do for i,players in ipairs (getElementsByType ("player")) do setElementCollidableWith (peds,players,false) end for i,vehicles in ipairs (getElementsByType ("vehicle")) do setElementCollidableWith (peds,vehicles,false) end for i,objects in ipairs (getElementsByType ("object")) do setElementCollidableWith (peds,objects,false) end end end,10000,0)
Tekken Posted December 31, 2020 Posted December 31, 2020 Well when you spawn a object you do serElementColidableWith Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
Moderators IIYAMA Posted December 31, 2020 Moderators Posted December 31, 2020 (edited) 3 hours ago, SoManyTears said: these codes I wrote do drop fps every 10 seconds.How can I use the setlementCollidableWith function properly? please help friends. You could apply the effect only when the elements are streamed in, that would be an enormous improved in terms of performance. -- already streamed in elements for i,peds in ipairs (getElementsByType ("ped", root, true)) do for i,players in ipairs (getElementsByType ("player", root, true)) do setElementCollidableWith (peds,players,false) end for i,vehicles in ipairs (getElementsByType ("vehicle", root, true)) do setElementCollidableWith (peds,vehicles,false) end for i,objects in ipairs (getElementsByType ("object", root, true)) do setElementCollidableWith (peds,objects,false) end end -- -- new streamed in elements local acceptedElementTypes = {player = true, vehicle = true, object = true} addEventHandler( "onClientElementStreamIn", root, function ( ) local elementType = getElementType( source ) if acceptedElementTypes[elementType] then local peds = getElementsByType ("ped", root, true) for i=1, #peds do local ped = peds[i] setElementCollidableWith (ped,source,false) end elseif elementType == "ped" then -- what if it is a new ped? You can program this step yourself. end end ) Edited December 31, 2020 by IIYAMA 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Moderators IIYAMA Posted January 2, 2021 Moderators Posted January 2, 2021 @SoManyTears Is your problem resolved? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
SoManyTears Posted January 3, 2021 Author Posted January 3, 2021 On 02/01/2021 at 16:22, IIYAMA said: @SoManyTears Is your problem resolved? thank you for your help IIYAMA. i was away from the computer.I tried this but failed.still peds cannot pass through objects.
Moderators IIYAMA Posted January 3, 2021 Moderators Posted January 3, 2021 37 minutes ago, SoManyTears said: thank you for your help IIYAMA. i was away from the computer.I tried this but failed.still peds cannot pass through objects. I assume you filled in the last part? (where my comment is) Please show me what you cooked from it. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
SoManyTears Posted January 13, 2021 Author Posted January 13, 2021 hey ı was far away from my pc.ı did this man ! thank you 1
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