├── .gitattributes ├── ReadMe.md ├── client.lua ├── config.lua └── fxmanifest.lua /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | # CodeStudio Intro Cutscene Start with AI Taxi | Standalone 2 | 3 | ⚠️ Since this is a free open-source script, we don't provide personal support due to time constraints. If you need personalized support, please consider using Tebex for assistance/support. 4 | 5 | https://discord.gg/62jqEKz8Sb 6 | 7 | 1. Event to Trigger the cutscene 8 | ```lua 9 | TriggerEvent('cs:introCinematic:start') 10 | ``` 11 | 12 | ### It’s not a plug-and-play script. You’ll need to make it compatible with your server based on your needs, whether that’s integrating it with clothing, multicharacter, or a specific location. This script will work with any server 13 | -------------------------------------------------------------------------------- /client.lua: -------------------------------------------------------------------------------- 1 | local taxiVeh 2 | local isTaxi = false 3 | local Active = false 4 | 5 | local sub_b0b5 = { 6 | "MP_Plane_Passenger_1", "MP_Plane_Passenger_2", "MP_Plane_Passenger_3", 7 | "MP_Plane_Passenger_4", "MP_Plane_Passenger_5", "MP_Plane_Passenger_6", "MP_Plane_Passenger_7" 8 | } 9 | 10 | 11 | local function applyPedVariations(ped, variations) 12 | for _, v in ipairs(variations) do 13 | if v[1] ~= 2 then 14 | SetPedComponentVariation(ped, v[1], v[2], 0, 0) 15 | else 16 | SetPedComponentVariation(ped, v[1], v[2], 1, 1) 17 | end 18 | end 19 | for i = 0, 8 do 20 | ClearPedProp(ped, i) 21 | end 22 | end 23 | 24 | 25 | local function setPedOutfit(ped, outfitType) 26 | local outfits = { 27 | [0] = {{0, 21}, {2, 9}, {3, 1}, {4, 9}, {6, 4}, {8, 15}, {11, 10}}, 28 | [1] = {{0, 13}, {2, 5}, {3, 1}, {4, 10}, {6, 10}, {7, 11}, {8, 13}, {11, 10}}, 29 | [2] = {{0, 15}, {2, 1}, {3, 1}, {4, 0}, {6, 1}, {8, 2}, {11, 6}}, 30 | [3] = {{0, 14}, {2, 5}, {3, 3}, {4, 1}, {6, 11}, {8, 2}, {11, 3}}, 31 | [4] = {{0, 18}, {2, 15}, {3, 15}, {4, 2}, {6, 4}, {7, 4}, {8, 3}, {11, 4}}, 32 | [5] = {{0, 27}, {2, 7}, {3, 11}, {4, 4}, {6, 13}, {7, 5}, {8, 3}, {11, 2}}, 33 | [6] = {{0, 16}, {2, 15}, {3, 3}, {4, 5}, {6, 2}, {8, 2}, {11, 3}} 34 | } 35 | 36 | local selectedOutfit = outfits[outfitType] or outfits[0] 37 | applyPedVariations(ped, selectedOutfit) 38 | end 39 | 40 | RegisterNetEvent('cs:introCinematic:start', function() 41 | local plyrId = PlayerPedId() 42 | local gender = IsPedModel(plyrId, "mp_m_freemode_01") 43 | 44 | PrepareMusicEvent("FM_INTRO_START") 45 | TriggerMusicEvent("FM_INTRO_START") 46 | 47 | local cutsceneType = gender and 31 or 103 48 | RequestCutsceneWithPlaybackList("MP_INTRO_CONCAT", cutsceneType, 8) 49 | 50 | while not HasCutsceneLoaded() do Wait(10) end 51 | 52 | local entityModel = GetEntityModel(plyrId) 53 | local cutsceneEntity = gender and 'MP_Male_Character' or 'MP_Female_Character' 54 | 55 | RegisterEntityForCutscene(0, cutsceneEntity, 3, entityModel, 0) 56 | RegisterEntityForCutscene(plyrId, cutsceneEntity, 0, 0, 0) 57 | SetCutsceneEntityStreamingFlags(cutsceneEntity, 0, 1) 58 | 59 | local oppositeGenderEntity = RegisterEntityForCutscene(0, gender and "MP_Female_Character" or "MP_Male_Character", 3, 0, 64) 60 | NetworkSetEntityInvisibleToNetwork(oppositeGenderEntity, true) 61 | 62 | local ped = {} 63 | for i = 0, 6 do 64 | local isFemale = (i % 2 == 1) 65 | local model = isFemale and `mp_f_freemode_01` or `mp_m_freemode_01` 66 | RequestModel(model) 67 | while not HasModelLoaded(model) do Wait(10) end 68 | ped[i] = CreatePed(26, model, -1117.7778, -1557.6249, 3.3819, 0.0, false, false) 69 | SetEntityAsMissionEntity(ped[i], true, true) 70 | setPedOutfit(ped[i], i) 71 | RegisterEntityForCutscene(ped[i], sub_b0b5[i], 0, 0, 64) 72 | end 73 | 74 | NewLoadSceneStartSphere(-1212.79, -1673.52, 7, 1000, 0) 75 | SetWeatherTypeNow("EXTRASUNNY") 76 | StartCutscene(4) 77 | 78 | Wait(34520) -- Cutscene duration 79 | 80 | for i = 0, 6 do 81 | DeleteEntity(ped[i]) 82 | end 83 | 84 | PrepareMusicEvent("AC_STOP") 85 | TriggerMusicEvent("AC_STOP") 86 | StopCutsceneImmediately() 87 | 88 | DoScreenFadeOut(250) 89 | Wait(2500) 90 | 91 | ClearPedWetness(plyrId) 92 | 93 | if CodeStudio.useTaxi then 94 | CreateTaxi(CodeStudio.TaxiSpawn) 95 | else 96 | SetEntityCoords(plyrId, CodeStudio.SpawnPedLoc) 97 | DoScreenFadeIn(250) 98 | end 99 | end) 100 | 101 | 102 | function createTaxiPed(vehicle) 103 | local model = GetHashKey("a_m_y_stlat_01") 104 | if DoesEntityExist(vehicle) and IsModelValid(model) then 105 | RequestModel(model) 106 | while not HasModelLoaded(model) do Wait(1) end 107 | 108 | local taxiPed = CreatePedInsideVehicle(vehicle, 26, model, -1, true, false) 109 | SetAmbientVoiceName(taxiPed, "A_M_M_EASTSA_02_LATINO_FULL_01") 110 | SetBlockingOfNonTemporaryEvents(taxiPed, true) 111 | SetEntityAsMissionEntity(taxiPed, true, true) 112 | SetModelAsNoLongerNeeded(model) 113 | 114 | return taxiPed 115 | end 116 | end 117 | 118 | function CreateTaxi(x, y, z) 119 | local taxiModel = CodeStudio.Taxi 120 | if IsModelValid(taxiModel) and IsThisModelACar(taxiModel) then 121 | RequestModel(taxiModel) 122 | while not HasModelLoaded(taxiModel) do Wait(1) end 123 | 124 | taxiVeh = CreateVehicle(taxiModel, x, y, z, CodeStudio.TaxiSpawn.w, true, false) 125 | SetVehicleNumberPlateText(taxiVeh, CodeStudio.TaxiPlate) 126 | SetEntityAsMissionEntity(taxiVeh, true, true) 127 | SetVehicleEngineOn(taxiVeh, true, true, false) 128 | 129 | if CodeStudio.TaxiModded then 130 | SetVehicleColours(taxiVeh, 0, 88) 131 | SetVehicleModKit(taxiVeh, 0) 132 | SetVehicleMod(taxiVeh, 10, 1, 0) 133 | end 134 | 135 | SetVehicleOnGroundProperly(taxiVeh) 136 | local taxiPed = createTaxiPed(taxiVeh) 137 | local blip = AddBlipForEntity(taxiVeh) 138 | SetBlipSprite(blip, 198) 139 | SetBlipFlashes(blip, true) 140 | SetBlipFlashTimer(blip, 5000) 141 | SetHornEnabled(taxiVeh, true) 142 | StartVehicleHorn(taxiVeh, 1000, GetHashKey("NORMAL"), false) 143 | SetPedIntoVehicle(PlayerPedId(), taxiVeh, 2) 144 | 145 | -- YOU CAN ADD YOUR FUEL EVENT HERE FOR EXAMPLE: 146 | --exports['cdn-fuel']:SetFuel(taxiVeh, 100) 147 | -- exports['LegacyFuel']:SetFuel(taxiVeh, 100) 148 | 149 | if IsPedInVehicle(PlayerPedId(), taxiVeh, 1) then 150 | DoScreenFadeIn(250) 151 | Notify(CodeStudio.WelcomeMessage) 152 | SetVehicleDoorsLocked(taxiVeh, 4) 153 | TaskVehicleDriveToCoord(taxiPed, taxiVeh, CodeStudio.TaxiDestination.x, CodeStudio.TaxiDestination.y, CodeStudio.TaxiDestination.z, 200.0, 0, GetEntityModel(taxiVeh), 786859, true) 154 | SetPedKeepTask(taxiPed, true) 155 | 156 | Active = true 157 | isTaxi = true 158 | TaxiRunning(taxiPed) 159 | end 160 | end 161 | end 162 | 163 | function TaxiRunning(taxiPed) 164 | local sleep = 200 165 | while Active do 166 | local dist = #(GetEntityCoords(PlayerPedId()) - vector3(CodeStudio.TaxiDestination.x, CodeStudio.TaxiDestination.y, CodeStudio.TaxiDestination.z)) 167 | if dist <= 10 then 168 | local player = PlayerPedId() 169 | local vehicle = GetVehiclePedIsIn(player, false) 170 | 171 | for i = 19, 6, -4 do 172 | SetVehicleForwardSpeed(vehicle, i) 173 | Wait(200) 174 | end 175 | SetVehicleForwardSpeed(vehicle, 0.0) 176 | 177 | Notify(CodeStudio.ReachedMessage) 178 | SetVehicleDoorsLocked(vehicle, 1) 179 | 180 | TaskLeaveVehicle(player, vehicle, 0) 181 | Wait(2500) 182 | DeleteTaxi(vehicle, taxiPed) 183 | 184 | Active = false 185 | isTaxi = false 186 | end 187 | 188 | if isTaxi then 189 | sleep = 3 190 | DisplayHelpText('Press ~INPUT_FRONTEND_RRIGHT~ Skip Drive') 191 | 192 | if IsControlJustPressed(1, 194) then 193 | local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) 194 | isTaxi = false 195 | sleep = 200 196 | DoScreenFadeOut(2500) 197 | Wait(3000) 198 | SetEntityCoords(vehicle, vector3(CodeStudio.SkipToNearestLoc.x, CodeStudio.SkipToNearestLoc.y, CodeStudio.SkipToNearestLoc.z)) 199 | SetEntityHeading(vehicle, CodeStudio.SkipToNearestLoc.w) 200 | DoScreenFadeIn(250) 201 | end 202 | end 203 | Wait(sleep) 204 | end 205 | end 206 | 207 | 208 | function DeleteTaxi(vehicle, driver) 209 | if DoesEntityExist(vehicle) and DoesEntityExist(driver) then 210 | if IsPedInVehicle(PlayerPedId(), vehicle, false) then 211 | TaskLeaveVehicle(PlayerPedId(), vehicle, 0) 212 | Wait(2000) 213 | end 214 | 215 | TaskVehicleDriveWander(driver, vehicle, 60.0, 786859) 216 | local blip = GetBlipFromEntity(vehicle) 217 | if DoesBlipExist(blip) then 218 | RemoveBlip(blip) 219 | end 220 | 221 | SetEntityAsNoLongerNeeded(vehicle) 222 | SetPedAsNoLongerNeeded(driver) 223 | 224 | Wait(5000) 225 | 226 | if DoesEntityExist(vehicle) then DeleteEntity(vehicle) end 227 | if DoesEntityExist(driver) then DeleteEntity(driver) end 228 | end 229 | end 230 | 231 | 232 | -- Display help text function 233 | function DisplayHelpText(str) 234 | SetTextComponentFormat("STRING") 235 | AddTextComponentString(str) 236 | DisplayHelpTextFromStringLabel(0, 0, 1, -1) 237 | end 238 | 239 | 240 | RegisterCommand('test_scene', function() 241 | TriggerEvent('cs:introCinematic:start') 242 | end) -------------------------------------------------------------------------------- /config.lua: -------------------------------------------------------------------------------- 1 | CodeStudio = {} 2 | 3 | 4 | CodeStudio.useTaxi = true --Use AI Taxi or Not? 5 | CodeStudio.SpawnPedLoc = vector3(-1044.91, -2750.2, 21.36) --If not using AI Taxi then set player spawn location 6 | 7 | CodeStudio.Taxi = `dynasty` --Taxi Model 8 | CodeStudio.TaxiPlate = 'CS5M' --Taxi Number Plate 9 | CodeStudio.TaxiModded = true 10 | CodeStudio.TaxiSpawn = vector4(-1058.48, -2713.28, 20.17, 240.05) --Taxi First Spawn Location 11 | CodeStudio.TaxiDestination = vector4(-1087.01, -271.25, 37.32, 26.0) --Taxi Destination Lcoation 12 | CodeStudio.SkipToNearestLoc = vector4(-1198.92, -304.74, 37.47, 284.08) --Taxi Skip Nearest Location to destination 13 | 14 | 15 | CodeStudio.WelcomeMessage = 'Welocome To My Server' 16 | CodeStudio.ReachedMessage = "We've reached our destination" 17 | 18 | 19 | 20 | function Notify(msg) 21 | SetNotificationTextEntry('STRING') --- DELETE ME IF YOU ARE USING ANOTHER SYSTEM 22 | AddTextComponentString(msg) --- DELETE ME IF YOU ARE USING ANOTHER SYSTEM 23 | DrawNotification(0,1) --- DELETE ME IF YOU ARE USING ANOTHER SYSTEM 24 | end -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'adamant' 2 | game 'gta5' 3 | author 'CodeStudio' 4 | description 'Intro Cutscene Start with AI Taxi' 5 | version '1.1' 6 | 7 | client_scripts {'client.lua','config.lua'} 8 | --------------------------------------------------------------------------------