Skip to content

Instantly share code, notes, and snippets.

@ItsJunction
Last active October 22, 2023 19:32
Show Gist options
  • Save ItsJunction/7aaf4ca0d28af82f5640240beb9419e9 to your computer and use it in GitHub Desktop.
Save ItsJunction/7aaf4ca0d28af82f5640240beb9419e9 to your computer and use it in GitHub Desktop.
Ghosts from GTA Online - old research code from a quickly scrapped proj a few months back that others may benefit from. Only spawns one ghost at the player's current location, nothing special really
-- Supported on 2944+
-- RequestScriptAudioBank("DLC_MP2023_1/DLC_MP2023_1_GH", false)
-- PlaySoundFromEntity(-1, "Male_Ghost", 10754, "Ghost_Hunt_Sounds", false, false)
-- PlaySoundFromEntity(-1, "Female_Ghost", PlayerPedId(), "Ghost_Hunt_Sounds", 0, 0)
-- PlaySoundFrontend(-1, "Collect_Shard", "Ghost_Hunt_Sounds", false)
-- NetworkOverrideClockTime(0, 0, 0)
Citizen.CreateThread(function()
RequestNamedPtfxAsset("scr_srr_hal")
while not HasNamedPtfxAssetLoaded("scr_srr_hal") do
Citizen.Wait(0)
end
local model = GetHashKey("m23_1_prop_m31_ghostzombie_01a") --update\x64\dlcpacks\mp2023_01\dlc.rpf\x64\levels\gta5\props\prop_m23_1_deathmatch.rpf\
RequestModel(model)
while not HasModelLoaded(model) do Citizen.Wait(0) end
local prop = CreateObject(model, GetGroundZFor_3dCoord(GetEntityCoords(PlayerPedId(), true), false), false, true, false)
FreezeEntityPosition(prop, true)
SetEntityHeading(prop, GetEntityHeading(PlayerPedId()))
UseParticleFxAsset("scr_srr_hal")
StartParticleFxLoopedOnEntity("scr_srr_hal_ghost_haze", prop, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0, 0.7, false, false, false)
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment