Jump to content

LUA . Breakable!


Kekoo

Recommended Posts

Posted (edited)

Hello dudes!

Iv been working on one mapping in my Map Editor server some days now.

And im wondering cuz iv got it to Doublesided and Collision false.

But i aint getting ths fucking Breakable to work.

The mapping is made in .MAP file. Its changed to an .lua now,

This is how it looks like now . (Its an example)

  
  
for k, v in ipairs({  
createObject ( 2232, 247.8, -233.89999, 6.1, 0, 0, 90 ), 
createObject ( 3920, 242.3, -230.3, 9.8, 0, 0, 90 ), 
createObject ( 3920, 242.39999, -242.8, 9.8, 0, 0, 90 ), 
createObject ( 3920, 242.39999, -249, 9.8, 0, 0, 90 ), 
  
 }) do 
     setElementDoubleSided(v, true) 
     setElementInterior(v,0) 
    setElementDimension(v,0) 
     setElementCollisionsEnabled(v, true) 
     setObjectBreakable(v, false) 
 end     
  

I did found the setObjectBreakable here on the wiki. But It aint working so maybe some of you guys know how i would do.

its these windows in sf car shop or what i would call it. Buts its exactly near Train Station. The windows there i wan to be Un-breakable

Thanks For Answeres!

Edited by Guest
  • Moderators
Posted

Function works fine with me, you should execute it clientside.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

Bonsai.

These object i did place here is just for an example.

The ones i want to be un-brakable is the windows in SF Carshow place. But its on a mapped base

Posted

setObjectBreakable is client-side only. This means it can only be triggered on the client, and not the server.

You can use triggerClientEvent to have the Server trigger client-side events which will set those objects as breakable or not. Use the aforementioned function to transmit the object elements to the client.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...