Sub OnAttack(index)'********************************Dim randomiserDim maxDim noteDim player_weaponDim weapon_slotweapon_slot=Int(getplayerweaponslot(index))player_weapon=Int(Getplayerinvitemnum(index, Int(weapon_slot) ) )Select Case player_weaponCase 1max = Getvar("scripts\guitarsounds.ini", "index", "total_sounds")randomiser = Int((Int(max) + 1) * Rnd) + 0If randomiser = 0 Thenrandomiser = 1End If note = GetVar("scripts\guitarsounds.ini", "sounds", Int(randomiser))Call PlaySound(index, note)End SelectEnd sub
[INDEX]total_sounds=6[SOUNDS]1=do.wav2=dosus.wav3=re.wav4=resus.wav5=mi.wav6=fa.wav7=fasus.wav8=sol.wav9=solsus.wav10=la.wav11=lasus.wav12=si.wav13=slide.wav