07-10-2013, 03:20 PM
Is there a way to play music when i touch an object? Like, can i pick up an item and then once i pick it up music plays? If so, then can someone plz help me! Thx!
(07-10-2013, 07:15 PM)The chaser Wrote: [ -> ]void OnStart()
{
SetEntityCallbackFunc("item", "OnPickup");
}
void OnPickup(string &in asEntity, string &in type)
{
PlayMusic("music.ogg", false, 1, 1, 1, false);
}
Source script from here:
http://wiki.frictionalgames.com/hpl2/tut...n_entities
(07-11-2013, 12:16 AM)iLucian Wrote: [ -> ](07-10-2013, 07:15 PM)The chaser Wrote: [ -> ]void OnStart()
{
SetEntityCallbackFunc("item", "OnPickup");
}
void OnPickup(string &in asEntity, string &in type)
{
PlayMusic("music.ogg", false, 1, 1, 1, false);
}
Source script from here:
http://wiki.frictionalgames.com/hpl2/tut...n_entities
I dont know why but this isnt working for me
(07-11-2013, 12:47 AM)WIWWM Wrote: [ -> ](07-11-2013, 12:16 AM)iLucian Wrote: [ -> ](07-10-2013, 07:15 PM)The chaser Wrote: [ -> ]void OnStart()
{
SetEntityCallbackFunc("item", "OnPickup");
}
void OnPickup(string &in asEntity, string &in type)
{
PlayMusic("music.ogg", false, 1, 1, 1, false);
}
Source script from here:
http://wiki.frictionalgames.com/hpl2/tut...n_entities
I dont know why but this isnt working for me
You have to have the item in your map named "item" (no quotations)
Do you know the basics of coding?
(07-11-2013, 02:21 PM)The chaser Wrote: [ -> ]What item are you using? An Item is something you can pick up, an entity is something you can grab and interact with.