Scripts / Can someone check over my script for me please

Author
Message
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 17th May 2017 13:26
Hi guys, i'm trying to create a script so that when you get within a certain distance of an object it randomly plays one of four sounds in its slots, with a delay of 5 seconds in between sounds.

Here's what i have come up with so far:



At the moment i am at work so i cant get into gameguru, but i'd like to have it working before i get home so i can just add it to my project, could somebody please check it for me and if there is anything wrong with it let me know so i can fix it before heading home from work tonight

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.

Attachments

Login to view attachments
J_C
17
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 17th May 2017 16:53
Hi Belidos hope this helps..



Attachments

Login to view attachments
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 17th May 2017 17:21
Thanks JC, i tried my best, but some parts of LUA (especially randoms and timers) still eludes me

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th May 2017 18:23
if you're using the public preview you might also want to check out the new sound commands
Quote: "PlayRawSound: PlayRawSound ( iID ) -- where iID is the raw engine sound index
LoopRawSound: LoopRawSound ( iID ) -- where iID is the raw engine sound index
StopRawSound: StopRawSound ( iID ) -- where iID is the raw engine sound index
SetRawSoundVolume: SetRawSoundVolume ( iID, iVolume ) -- where iID is the raw engine sound index and iVolume from 0 to 100
RawSoundExist: iFlag = RawSoundExist ( iID ) -- where iID is the raw engine sound index
RawSoundPlaying: iFlag = RawSoundPlaying ( iID ) -- where iID is the raw engine sound index"

haven't used them myself yet so not entirely sure what the ilD is as i don't see any loadrawsound command but it might just be missing from the list
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 18th May 2017 07:36
Thanks guys, much appreciated.


That looks far to confusing to me smallg, i'll wait until someone else has worked them out and posted some examples, i've no idea what a Raw Sound is, and even less idea about what it's index would be, and for that matter where LUA is concerned what an index is.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.

Login to post a reply

Server time is: 2024-12-23 06:04:24
Your offset time is: 2024-12-23 06:04:24