Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Lines of code that plays sound wont play the sound?

So i have this code in a local script:

local replicatedstorage = game:GetService("ReplicatedStorage")
local standevent = replicatedstorage.Stand
local rot = stand:WaitForChild("StandHumanoidRootPart")


	local countsfx = rot.Count
	replicatedstorage.SndPlay:FireServer(countersfx)

There is more code then this but they dont mess with sound so i dont think its necessary to put them here.

The sound wont play for the Players OR the server/Other players, Help?

3 comments

0

I've went through this once, not sure why it happens tbh.

0

Does the sound get removed before playing?

0

No, it doesnt play at all but doesnt get removed.

1 answer

stand isn't a local. You need "Stand" as a local to go with whatever is here.

local rot = stand:WaitForChild("StandHumanoidRootPart")

Otherwise, here's your current script fixed:

-- add the "stand" local first
local rot = stand:WaitForChild("StandHumanoidRootPart")

        local countsfx = rot.Count
        game.ReplicatedStorage.SndPlay:FireServer(countsfx)

1 comment

0

This doesnt work this only plays on the client and everyone else cant hear it.

This discussion is preserved as it was. New answers, comments, and votes are closed.