Jump to content

ShiDiNips

Members
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ShiDiNips

  • Rank
    Square
  1. "lastTrigger" wasn't recognized that's why It keeps calling and spamming the "onClientPlaySound" every minute which makes the server and the players lag
  2. how about this? -- server function timeFunction(sourcePlayer) local timehour = getTime() if timehour == 6 or timehour == 7 or timehour == 8 or timehour == 9 or timehour == 10 or timehour == 11 or timehour == 12 or timehour == 13 or timehour == 14 or timehour == 15 or timehour == 16 or timehour == 17 or timehour == 18 or timehour == 19 then triggerClientEvent(getRootElement(), "onClientPlaySound", resourceRoot) triggerClientEvent(getRootElement(), "onClientPlaySoundAmb", resourceRoot) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), t
  3. If I do setTimer(theFunction, 60000,0) it will repeat the sound every 1 minute and that will be annoying tho
  4. Because I have this... local locationstown = { {-90.736328125, 1122.5888671875, 0}, {-1475.625, 2629.337890625, 0}, {-2445.4267578125, 2388.9111328125, 0} } for i=1 ,#locationstown do local xtown, ytown, ztown = locationstown[i][1], locationstown[i][2], locationstown[i][3] function ambtowntiming() local realtime = getRealTme() local hours = realtime.hour local minutes = realtime.minute if hours == 06 and minutes == 30 then ambtown = playSound3D("ambtown.mp3", xtown, ytown, ztown, true) setSoundMaxDistance(ambtown, 1000) setSoundPanningEnabled (ambtown, false) stopSound(a
  5. Yes, it seems like it dont work for me
  6. -- client local locsfortown:~ = { {-86.4970703125, 1120.2216796875, 0}, {-1475.625, 2629.337890625, 0}, {-2445.4267578125, 2388.9111328125, 0} } for i=1 ,#locsfortown:~ do function onClientPlaySound() xtown, ytown, ztown = locsfortown:~[i][1], locsfortown:~[i][2], locsfortown:~[i][3] ambtown = playSound3D("ambtown.mp3", xtown, ytown, ztown, true) setSoundMaxDistance(ambtown, 1000) setSoundPanningEnabled (ambtown, false) end end addEvent("onClientPlaySound", true) addEventHandler("onClientPlaySound", resourceRoot, onClientPlaySound) -- server function timeFunction() local real
  7. realtime says nil hours says nil minutes says nil
  8. Weirdly enough, still doesn't work and no bugs were found in /debugscript 3
  9. You mean like this? Client: function playdaysound() sound = playSound3D("daytime.mp3", x, y, z, true) setSoundMaxDistance(sound , 1000) setSoundPanningEnabled (sound , false) end addEvent("playdemsound", true) addEventHandler ( "playdemsound", getLocalPlayer(), playdaysound ) Server: setTimer(function daytime() local realtime = getRealTime() local hours = realtime.hour local minutes = realtime.minute if hours == 07 and minutes == 00 then triggerClientEvent("playdemsound") end end, 1, source)
  10. If you meant like.. "onResourceStart", I already did that.. Also, isn't setTimer will only play something if the time set to setTimer is finished? That's why I was hoping that I could play sound using the game time
  11. If you're looking for a way to make GUI visible via key, use bindKey
  12. Hello guys, new here.. So I was making this script where it plays a sound on a location.. Let's say it's' 07:00 on game it plays "daytime.mp3" and when it's 22:00 on game it plays "nighttime.mp3". Here's the code I made in clientside function daytime() local hour, minute = getTime() if (hour == 07 and minute == 00) then sound = playSound3D("daytime.mp3", x, y, z, true) setSoundMaxDistance(sound , 1000) setSoundPanningEnabled (sound , false) end end Thanks in advance I already tried function daytime() local realtime = getRealTime() local hours = realtime.
×
×
  • Create New...