=RM=Mario Posted September 4, 2009 Share Posted September 4, 2009 Hi,ive been trying for many hours to get this to work,but failed.even tried to go on irc,well any ways im trying to make a script for Custom music to play at Grove Steet.and no there is no warinings or errors in debugscript,so please help function onResourceStart() local sound = playSound3D("xenon.mp3", 2484.0263671875, -1668.2800292969, 13.34375, true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) and here is meta file if theres any mistakes </meta> <info author="Mario" description="Music at Grove" version="1.0" type="map" /> <script src="musicxeno.lua" type="client" /> <file src="xenon.mp3" /> </meta> Link to comment
Ryder! Posted September 4, 2009 Share Posted September 4, 2009 try <file src="xenon.mp3" type="client" /> Link to comment
=RM=Mario Posted September 4, 2009 Author Share Posted September 4, 2009 Thanks but didnt work Link to comment
50p Posted September 4, 2009 Share Posted September 4, 2009 1. Check your debug window for any warnings/errors. The command is: /debugscript 3 2. Use outputChatBox or outputDebugString functions to display what playSound3D returned. Link to comment
subenji99 Posted September 4, 2009 Share Posted September 4, 2009 Completely crazy idea, I'm probably WAYYY off here, but maybe it's because you defined this resource as type="map" but it doesn't have a map or race file defined. Try type="script". Link to comment
=RM=Mario Posted September 4, 2009 Author Share Posted September 4, 2009 and no there is no warinings or errors in debugscript,so please helpyeah but i said i did that but it didnt say any errors or warinings Link to comment
50p Posted September 4, 2009 Share Posted September 4, 2009 and no there is no warinings or errors in debugscript,so please helpyeah but i said i did that but it didnt say any errors or warinings Did you try my other point (no.2)? Link to comment
=RM=Mario Posted September 4, 2009 Author Share Posted September 4, 2009 no idea how to do that Link to comment
50p Posted September 4, 2009 Share Posted September 4, 2009 Basically, you just debug your code. After you call playSound3D your local sound variable will hold a value/data of what playSound3D returned. If playSound3D failed the sound variable will hold false. So, to find out what that sound variable is you need to show that to yourself with outputDebugString or outputChatBox functions. outputChatBox( tostring( sound ) ); -- you need to use tostring because playSound3D doesn't return string Link to comment
=RM=Mario Posted September 4, 2009 Author Share Posted September 4, 2009 sorry for the noob Question....but where do i type this? outputChatBox( tostring( sound ) ); -- you need to use tostring because playSound3D doesn't return string Link to comment
subenji99 Posted September 4, 2009 Share Posted September 4, 2009 function onResourceStart() local sound = playSound3D("xenon.mp3", 2484.0263671875, -1668.2800292969, 13.34375, true) outputChatBox( tostring( sound ) ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) Link to comment
=RM=Mario Posted September 4, 2009 Author Share Posted September 4, 2009 function onResourceStart() local sound = playSound3D("xenon.mp3", 2484.0263671875, -1668.2800292969, 13.34375, true) outputChatBox( tostring( sound ) ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) did this,nothing.. Link to comment
50p Posted September 4, 2009 Share Posted September 4, 2009 What do you mean nothing? Didn't you see anything in your chat box or sound did play? Besides, you don't have to use getThisResource in getResourceRootElement since getThisResource is default argument. Link to comment
=RM=Mario Posted September 4, 2009 Author Share Posted September 4, 2009 i dont see anything in chatbox,and music isnt playing Link to comment
50p Posted September 4, 2009 Share Posted September 4, 2009 i dont see anything in chatbox,and music isnt playing - Are you sure you started the script? - Are you sure your script is updated? - Make sure you don't edit the resource in "resourcecache" folder. - Is this folder or zip resource? If it's zip resource, make sure you don't have a folder with the same name. Link to comment
=RM=Mario Posted September 4, 2009 Author Share Posted September 4, 2009 i dont see anything in chatbox,and music isnt playing - Are you sure you started the script? - Are you sure your script is updated? - Make sure you don't edit the resource in "resourcecache" folder. - Is this folder or zip resource? If it's zip resource, make sure you don't have a folder with the same name. yes i started script with admin Panel,yes i made sure i didnt edit resourcecache,and its a Folder Link to comment
x86 Posted September 4, 2009 Share Posted September 4, 2009 Your meta.xml: <[color=#FF0000]/[/color]meta> <info author="Mario" description="Music at Grove" version="1.0" type="map" /> <script src="musicxeno.lua" type="client" /> <file src="xenon.mp3" /> </meta> I think this is right: <meta> <info author="Mario" description="Music at Grove" version="1.0" type="map" /> <script src="musicxeno.lua" type="client" /> <file src="xenon.mp3" /> </meta> Link to comment
50p Posted September 4, 2009 Share Posted September 4, 2009 Your meta.xml: <[color=#FF0000]/[/color]meta> <info author="Mario" description="Music at Grove" version="1.0" type="map" /> <script src="musicxeno.lua" type="client" /> <file src="xenon.mp3" /> </meta> I think this is right: <meta> <info author="Mario" description="Music at Grove" version="1.0" type="map" /> <script src="musicxeno.lua" type="client" /> <file src="xenon.mp3" /> </meta> This is correct... I'm going to stop helping people at 5am. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now