Jump to content

whats wrong here


StreetSaintz

Recommended Posts

Hey guys, i have this script it works with quit and when i change my nick but it doesn't do anything when a player joins the server:

part of the code:

local joinSoundBlock = true 
addEvent("onPlayerJoinFlag", true) 
addEventHandler("onPlayerJoinFlag", getRootElement(), function(thePlayer, thecountry) 
    AddingS("join", getPlayerName(thePlayer).."#FFFFFF Oyuna girdi  #FF4000[#ffffff"..thecountry.."#FF4000]") 
    if(joinSoundBlock)then 
        local sound = playSound("joinSound.mp3") 
        setSoundVolume(sound, 0.2) 
        joinSoundBlock = false 
        setTimer(function() joinSoundBlock = true end, 30000, 1) 
    end 
end 
) 

Link to comment

Simply ... Just try this

This is client-side

-Sound.lua

  
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() 
    setTimer(function() 
        playSound("music.mp3") 
    end, 2000, 1) 
end 
) 
  

-meta.xml

  

      

Just change music.mp3 with your file's name... :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...