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

My sound zone isnt working and output is BLANK?

Asked by
iuclds 720 Moderation Voter
5 years ago
Edited 5 years ago

So here is the First part

FirstZone=workspace.Dry
FirstZoneSound=workspace.Dry.DrySound

You see they are both not labeled nil, right? these are:

SecondZone=nil
SecondZoneSound=nil

ThirdZone=nil
ThirdZoneSound=nil

FourthZone=nil
FourthZoneSound=nil

FifthZone=nil
FifthZoneSound=nil

SixthZone=nil
SixthZoneSound=nil

SeventhZone=nil
SeventhZoneSound=nil

EighthZone=nil
EighthZoneSound=nil

NinthZone=nil
NinthZoneSound=nil

TenthZoneZone=nil
TenthZoneZoneSound=nil

Thats what I expected. Now when I do this script (inside StarterPlayerScripts because I don't use that):

while FirstZone == not nil do
    wait(.001)
    if FirstZone.Touched then
    FirstZoneSound.Playing = true elseif

     FirstZone.TouchEnded then
        FirstZoneSound.Playing = false
    end
end

I expected the sound zones to work but instead I got a dumb blank output. Any help?

1 answer

Log in to vote
1
Answered by 5 years ago
FirstZone.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
            FirstZoneSound.Playing = true
    end
end)

FirstZone.TouchEnded:Connect(function()
    FirstZoneSound.Playing = false
end)
Ad

Answer this question