of     1   

ByteInfinity
#141046079Monday, July 21, 2014 10:57 AM GMT

Trying to play music pressing z or turn it off by pressing x function music() local sound = Instance.new("Sound") sound.SoundId = "http://roblox.com/asset/?id=142533417" sound.Parent = game.Players.LocalPlayer.PlayerGui sound.Volume = 1 sound:Play() wait(75) sound:Destroy() end function musicstop() if game.Players.LocalPlayer.PlayerGui:FindFirstChild("Sound") then game.Players.LocalPlayer.PlayerGui.Sound.Volume = 0 game.Players.LocalPlayer.PlayerGui.Sound:Destroy() else print("No Sound") end end -- end of functions for _,plr in pairs (game.Players:GetPlayers()) do if plr.Backpack then local mouse = plr:GetMouse() mouse.KeyDown:connect(function(key) if key:lower() == "z" then music() elseif key:lower() == "x" then musicstop() end end) end end
ByteInfinity
#141058719Monday, July 21, 2014 3:05 PM GMT

Any day now like wtf Bump
AggressiveCatch
#141058747Monday, July 21, 2014 3:05 PM GMT

Use dev console to get the output and tell us what it is.
ByteInfinity
#141058881Monday, July 21, 2014 3:07 PM GMT

Why do I need the console? If it works on studio, it should work in game. And it's not. The output in studio would of told me the error
AggressiveCatch
#141059031Monday, July 21, 2014 3:09 PM GMT

if you don't want to check the dev console, i can't help you it's that simple
C_Sharper
#141059163Monday, July 21, 2014 3:11 PM GMT

Using KeyDown requires a LocalScript. Yes, yes it does. I recommend putting a LocalScript in the startergui. Along with a repeat wait() until game.Players.LocalPlayer at the start of the code.
ByteInfinity
#141059266Monday, July 21, 2014 3:13 PM GMT

Thanks hyroad
C_Sharper
#141059331Monday, July 21, 2014 3:13 PM GMT

I meant to say using GetMouse() Not keydown. But, did this work?
ked2000
#141059391Monday, July 21, 2014 3:14 PM GMT

@Byte You are making it harder for yourself by being ignorant. It seems that you are using a Script instead of a LocalScript, well there's your problem.
ByteInfinity
#141060044Monday, July 21, 2014 3:22 PM GMT

I will try local script when I get home. I'm on my galaxy s4 about to have surgery and how the hell am I being ignorant?
C_Sharper
#141060130Monday, July 21, 2014 3:23 PM GMT

He's not being ignorant -_-
AggressiveCatch
#141060146Monday, July 21, 2014 3:23 PM GMT

Because you refused to check the dev console which would have gave us the reason of the error without having us guess possible problems.
ByteInfinity
#141119479Tuesday, July 22, 2014 1:35 AM GMT

The studio would of given us the error and it didn't. It worked just fine. I'm going to try to put it in a local script now.

    of     1