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

Sound isn't playing in block Why isn't this working?

Asked by 7 years ago
function touch(hit)
    if hit.Parent:FindFirstChild("Humanoid") ~= nil then
        local char = hit.Parent
        local plar = game.Players:GetPlayerFromCharacter(char)
        local Hum = char.Humanoid
        if plar.TeamColor == "Maroon" then
            script.Parent.Siren:Play()

            else 
        end
        char.Torso.Anchored = true
        for i, amTrack in pairs(Hum:GetPlayingAnimationTracks()) do
        amTrack:Stop()
        end
        wait(2)
        char.Torso.CFrame = script.Parent.Parent.Tele2.CFrame * CFrame.new(0, 3, 0)
        wait(2)
        for i, amTrack in pairs(Hum:GetPlayingAnimationTracks()) do
        amTrack:Play()
        end
        char.Torso.Anchored = false
        else return
    end
end
script.Parent.Touched:connect(touch)

The Sound doesn't play. Any ideas why?

1 answer

Log in to vote
1
Answered by
P100D 590 Moderation Voter
7 years ago

plar.TeamColor doesn't return a string, it returns a BrickColor. If you want to check if the player's TeamColor is Maroon, you're going to have to use BrickColor.new

Ad

Answer this question