[Request] Enhanced Forklift Script

Now we all know we can lift pallets and small things but the forklift is very limited. The Forklift is something I enjoy using in the game because it’s like a super realistic simulator. So the idea around this Script would allow the forks to pick up pallets, cars, etc and not drop it and have strong stabilization. If you can create this that would be awesome!

Example: https://www.youtube.com/watch?v=kPYmWeq2OBc

Some Old Code: https://pastebin.com/RKpcmXw7

Thanks!

Use the native attach entity to entity and attach the object to the forks. Use math the find the position for each object and that should make the object weightless allowing the forks to go up on any objects you want also making it not fall off.

Moved out of Feature requests as this isn’t a feature request for FiveM, please post in the right category next time

1 Like

Well I had no clue the right section, I figured the section that said request would be the right spot. Don’t get mad at me for having no idea.

I’m not mad just pointing it out :smile:

I’m not on here to argue just need this script made. That’s all.

Your name is “BlakeDevelops” shouldnt you be able to make this script on your own.

No I don’t do script building.

The hastebin has all the code you need, you only need to port it to FiveM script. (and maybe some networking)

Maybe if i’m bored later today i can take a look at it

Then what do you develop then. car stuff, peds stuff?

I mainly create HTML Server Loading Screens.

So then you write Javascript. Lua is pretty easy if you know Javascript. Or heck you could even convert that hastebin to Javascript on FiveM

Edit…

Talked to him on discord.

I made something real fast, you might need to change some things as it may show in the ground for some vehicles now

Feel free to give me any credits if you use it

code

isAttached = false
attachedEntity = nil

Citizen.CreateThread(function()
    while true do
        Wait(0)

        -- f10 to attach/detach
        if IsControlJustPressed(0, 57) then
			-- if already attached detach
			if isAttached then
				DetachEntity(attachedEntity, true, true)
				
				attachedEntity = nil
				isAttached = false
			else	
				-- get vehicle infront
				local pos = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 2.0, 0.0)
				local veh = GetClosestVehicle(pos, 2.0, 0, 70)
				
				-- if vehicle is found
				if veh ~= 0 and IsPedInAnyVehicle(PlayerPedId(), false) then
					local currentVehicle = GetVehiclePedIsIn(PlayerPedId(), false)
					
					-- check if player is in forklift
					if GetEntityModel(currentVehicle) == GetHashKey("forklift") then 
						isAttached = true
						attachedEntity = veh
						
						-- attach vehicle to forklift, you can change some values
						AttachEntityToEntity(veh, currentVehicle, 3, 0.0, 1.3, -0.09, 0.0, 0, 90.0, false, false, false, false, 2, true)
					end
				end
			end
        end        
    end
end)

video
https://s.theindra.eu/2019-01-20_01-18-20.mp4

2 Likes

Download it here: [Release] Enhanced Forklift Script

1 Like

Thanks Indra sent it to me before the release, so i’m first to use it. Thanks tho :slight_smile:

Np m8


I like to see the community help each other