[Release] Roll Windows

So I made a simple script which is pretty self explanatory,
if you type /rollw
the driver and passenger windows roll down, type it again, and they go up!


-- RollWindows written by JAF
-- Made for www.lacountyrp.com
-- Version 1.0.0

resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'    --(Thank you @Vespura)

-- Add a client script 
client_script 'client.lua'


local windowup = true
AddEventHandler('RollWindow', function()
    local playerPed = GetPlayerPed(-1)
    if IsPedInAnyVehicle(playerPed, false) then
        local playerCar = GetVehiclePedIsIn(playerPed, false)
		if ( GetPedInVehicleSeat( playerCar, -1 ) == playerPed ) then 
            SetEntityAsMissionEntity( playerCar, true, true )
			if ( windowup ) then
				RollDownWindow(playerCar, 0)
				RollDownWindow(playerCar, 1)
				TriggerEvent('chatMessage', '', {255,0,0}, 'Windows down')
				windowup = false
				RollUpWindow(playerCar, 0)
				RollUpWindow(playerCar, 1)
				TriggerEvent('chatMessage', '', {255,0,0}, 'Windows up')
				windowup = true
end )

RegisterCommand("rollw", function(source, args, raw)
end, false) --False, allow everyone to run it(thnx @Havoc)

Enjoy! More scripts are coming!


You know you can make this thing entirely client-side right? Just remove the “chatMessage” handler on the server and use the RegisterCommand native on the client.

Also, it’s bad practice to have no manifest version for the resource. You should at least use 77731fab-63ca-442c-a67b-abc70f28dfa5.


had no idea what is does, remove it, script still works. What does that actually do?

Also i don’t think many people care. They just want the script to work, but thanks, I’ll keep that in mind for later

Talking about the RegisterCommand or the resource manifest?

Resource Manifest info



Register Command Reference

I used the register command like on my other scripts, but didn’t seem to work, so i did it server sided,
thanks for answer tho

Well, sorry to say, you used it wrong.

RegisterCommand("rollw", function(source, args, raw)
end, false) --False, allow everyone to run it

Oh okay. i probably did,
I only started scripting a couple of weeks ago :confused:

1 Like

Not sure if someone can help, the mod works great clientside, but serverside the windows will go down but not up. any ideas?

I will check that. Didnt realize this.

Thank you, please keep me informed.

Is there a download? Or do we just make a folder in resources called rollw and make the client script?

Works just like any other resource.

Did you check out the server side roll up not working? only shows for the client that does the action.

@callmejaf my rollw folder wont load


1 Like

Load resource in server.cfg.

if you wanted windows to go up and down with the arrow keys (172, 173) how would you go about that can anyone help?

This is the editied version of this script. All i did is removing the print in chat as it’s annoying and i added a toggle for arrow down. So press once windows are down then press again and they are upclient.lua (808 Bytes) replace client.lua with the one i provided

1 Like

thanks a lot @XxFri3ndlyxX ill give it a go

@XxFri3ndlyxX keeps failing to load any ideas?