Hey guys I want to create an addon so when a player gets arrested it plays a .mp3 file and only them can hear it. But when I check the hooks there are no hooks for arrest on darkrp2.5. Does anyone know how to make it so when a player gets arrested it plays a .mp3?
K I have it done but when player is arrested it doesnt play the music
local sound = 'badboys.mp3'; resource.AddFile("sound/"..sound); hook.Add("playerArrested", "PlaySoundForArrested", function(crim, time, arrs) ply:SendLua("surface.PlaySound( "..sound.." )"); ) end
you put end after the )
put end before the closing bracket.
Needs to be surface.PlaySound(“badboys.mp3”) rather than surface.PlaySound(badboys.mp3).
You could either add in quotes and escape them or use different quotes:
ply:SendLua(“surface.PlaySound( “”…sound…”" )")
– or –
ply:SendLua(‘surface.PlaySound( "’…sound…’" )’)