Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I want to make a sound that people near me can hear, but how?

Asked by 8 years ago

Ok, so I'm a bounty hunter in a group, and my character is a wookiee. for those that dont know what that is, it's a character in something called star wars. and for those that do know what that is, then I'm sure you know that it makes the sound "Gaaaawwwrrrr" well, I'm trying to add a GUI in a morph that can make that sound, so I was able to do it, but when I tested it, no couldn't hear it, even up close. so I tried doing it all into script instead of local and, it did work.....in studio. but dosn't work now ingame and now I messed up the scripts and I really need assistance!!!!!!!!!!!!!!!!!!!!!!

Here are the scripts I'm using

local button = script.Parent local sound = button:WaitForChild('Roar')

local sound:Play()

local function onButtonClick() if sound.IsPlaying then sound:Stop() else sound:Play() end end

button.MouseButton1Click:connect(onButtonClick)

=============================================================================== Heres the GUI script im using

--By: StealthCloset AKA StealthMouse

function onTouched(hit) human = hit.Parent:findFirstChild("Humanoid") if (human == nil ) then return end PlayerName = hit.Parent.Name if (PlayerName == nil) then return end

 NameOfTool = "ScreenGui"
if (game.Players:findFirstChild(PlayerName).PlayerGui:findFirstChild(NameOfTool) == nil) then
    if (script:findFirstChild(NameOfTool) ~= nil) then
        script:findFirstChild(NameOfTool):clone().Parent = game.Players:findFirstChild(PlayerName).PlayerGui
        game.Players:findFirstChild(PlayerName).PlayerGui:findFirstChild(NameOfTool):findFirstChild("LocalScript").PNames.Value = (PlayerName)
    end
end
wait(1)

end

script.Parent.Touched:connect(onTouched)

0
You never set the parent of the sound to workspace, so it remains inside of your PlayerGui. This means only you could hear it. User#11440 120 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I would add the sound into a part rather than just have it stay in the Gui ( Which is why no one can hear it besides you.) If you don't want to keep it in the GUI, just move it in the script using script.Parent.

Ad

Answer this question