this is the script i´m using to play video when an item is picked up
g_storyinzone_mode = {}
function collect_item_play_videomaggot_init(e)
g_storyinzone_mode[e] = 0
end
function collect_item_play_videomaggot_main(e)
local Ent = g_Entity[e]
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 100 and g_PlayerHealth > 0 then
if video_ShowDecal ~= nil then
video_ShowDecal(Ent.x , Ent.y+ 20, Ent.z , g_PlayerAngX, g_PlayerAngY, g_PlayerAngZ,500)
end
PromptDuration("Press E to eat a fat maggot ",500)
if g_storyinzone_mode[e] ~= nil then
if g_storyinzone_mode[e] == 0 then
g_storyinzone_mode[e] = 1
HideHuds()
if radar_hideallsprites ~= nil then radar_hideallsprites() end
else
if g_storyinzone_mode[e] == 1 and g_KeyPressE == 1 then
PlaySound(e,0)
PlayVideo(e,1)
StopSound(e,0)
g_storyinzone_mode[e] = 2
Hide(e)
ActivateIfUsed(e)
else
if g_storyinzone_mode[e] == 2 then
if radar_showallsprites ~= nil then radar_showallsprites() end
ShowHuds()
PlaySound(e,2)
Destroy(e)
PromptDuration("you ate a fat maggot ",3000)
g_storyinzone_mode[e] = 3
end
end
end
end
end
end
LIFE ON EARTH IS EXPENSIVE BUT IT INCLUDES A FREE TRIP AROUND THE SUN