HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Sound problem.....

10-24-2003, 12:52 AM#1
wasabi
Can I play a sound to specific player?
All I could find was to play a sound to everybody.:(
I tried to attach a 3D sound to a unit , but other players still could hear the sound...
10-24-2003, 02:27 AM#2
Oinkerwinkle
You can use custom scripts.

Custom script: if (GetLocalPlayer()==GetTriggerPlayer()) then
Sound - Play sound YourSound
Custom script: endif
10-24-2003, 02:35 AM#3
wasabi
I'll try it, thx!8))
10-24-2003, 02:44 AM#4
Dragon
Quote:
Originally posted by Oinkerwinkle
You can use custom scripts.

Custom script: if (GetLocalPlayer()==GetTriggerPlayer()) then
Sound - Play sound YourSound
Custom script: endif


What does the "(GetLocalPlayer()==GetTriggerPlayer())" part do?
10-24-2003, 03:13 AM#5
35263526
Basically, that gets the triggering player and plays a sound 'locally', so only he hears it. You can use that script for all sorts of things that only work for all players in GUI.

One thing to think about is that use of GetLocalPlayer in multiplayer games can cause desync. It usually works for me, but you'll always have that problem.