Jump to content

[HELP]attach object


kiboka

Recommended Posts

function forklift.serverAttachBox(player)
local veh = getPedOccupiedVehicle(player)
	if isElement(veh) then
		if isElement(attachedBox[veh]) then return end
		attachedBox[veh] = createObject(boxID, 0, 0, 0)
		attachElements(attachedBox[veh], veh, 0, 1.4, -0.05)			    
	end
end
addEvent("serverAttachBox", true)
addEventHandler("serverAttachBox", root, forklift.serverAttachBox)

 

Link to comment
			if veh then
			    setElementInterior(veh, 1)
				setElementDimension(veh, getElementData(hitElement, "dbid") + 1000)
				setElementPosition(veh, -2052.6340332031, 157.98210144043, 28.842931747437)
				triggerServerEvent("serverAttachBox", localPlayer, localPlayer)
				
			end

Pls help 

Link to comment
			if veh then
  for i, v in ipairs(getAttachedElements(veh)) do 
          setElementInterior(v, 1)
			    setElementInterior(veh, 1)
				setElementDimension(veh, getElementData(hitElement, "dbid") + 1000)
				setElementPosition(veh, -2052.6340332031, 157.98210144043, 28.842931747437)
				triggerServerEvent("serverAttachBox", localPlayer, localPlayer)
				
			end
  end 

Try this 

Link to comment

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...