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

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

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

✓ Accepted answer

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

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