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

Why doesn't my click detector script play this sound?

Asked by 4 years ago

I made a animated door with tween service that uses click detectors, and wanted it to play a sound when you open/close it but it just ignores it.

local Service = game:GetService("TweenService")
local Gate = script.Parent.Parent.Gate
local Info = TweenInfo.new(2
script.Parent.ClickDetector.MouseClick:Connect(function()
game.ReplicatedStorage.DoorSound:Play()
script.Parent.CanCollide = false
local Change = {Position = Vector3.new(13.368, 4.705, 8.23)}
local Tween = Service:Create(Gate, Info, Change)
Tween:Play()
end)

Whats wrong with it?

0
Use WaitForChild() on DoorSound. If you're getting an infinite yield warning, check to make sure that DoorSound is a child of ReplicatedStorage. DeceptiveCaster 3761 — 4y
0
Welp i am getting an infinite yield warning and DoorSound is a child of ReplicatedStorage so...what now? User#22822 0 — 4y
0
Hello? User#22822 0 — 4y
0
Is anyone ever going to respond to thia again? User#22822 0 — 4y
View all comments (2 more)
0
Try moving the sound to Workspace as part of the part. Don't think that it works in ReplicatedStorage. M39a9am3R 3210 — 4y
0
Its still giving me an infinite yield warning User#22822 0 — 4y

Answer this question