Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/06/23 in all areas

  1. you're welcome,If you have a new question, please open a new topic and tag me.
    1 point
  2. Using these parameters totally depends on your needs and game scripts. If you do not need this additional information, you can omit or pass these parameters. I added these parameters to trigger onVehicleCollision hitElement: Collision object. In this case, it will be the object or element the vehicle collides with. force: The force of collision. This is a numeric value representing the severity of the collision. bodyPart: The part of the body where the collision occurred. For example, vehicle hood, windshield, rear bumper. collisionX, collisionY, collisionZ: Coordinates of the point where the collision occurred. normalX, normalY, normalZ: The normal of the collision surface. This is a vector that indicates which direction the collision surface is in. material1, material2: Strings representing the material types of the colliding objects.
    1 point
  3. local marker = -- The marker element you want to prevent the player from hitting function onVehicleCollision(hitElement, force, bodyPart, collisionX, collisionY, collisionZ, normalX, normalY, normalZ, material1, material2) if getElementType(hitElement) == "vehicle" then -- Check if the player is in a vehicle local player = getVehicleOccupant(hitElement) if player and getElementType(player) == "player" then -- Player is in a vehicle and colliding with the marker if isElementWithinMarker(hitElement, marker) then -- Do something here (e.g., cancel the collision, display a message, etc.) cancelEvent() end end end end addEventHandler("onVehicleCollision", root, onVehicleCollision)
    1 point
  4. local marker = -- The marker element you want to prevent the player from hitting function onVehicleCollision(hitElement) if hitElement == localPlayer and getElementType(hitElement) == "vehicle" then -- Check if the player is in a vehicle if isElementWithinMarker(hitElement, marker) then -- Player is in a vehicle and colliding with the marker -- Do something here (e.g., display a message, play a sound, etc.) -- To prevent the collision, you can remove the vehicle's speed local vehicle = getPedOccupiedVehicle(hitElement) setElementVelocity(vehicle, 0, 0, 0) end end end addEventHandler("onClientVehicleCollision", root, onVehicleCollision) https://wiki.multitheftauto.com/wiki/OnClientVehicleCollision
    1 point
  5. 1 point
  6. timeBar = 100 progBar = guiCreateProgressBar(321, 533, 159, 34, false) setTimer(function() timeBar = timeBar - 6.66666666667 lastTime = timeBar guiProgressBarSetProgress(progBar, lastTime) if lastTime <= 0 then guiSetVisible(progBar, false) end end, 1000, 15) I didn't understand, but one detail caught my attention and I wanted to edit it.
    1 point
×
×
  • Create New...