I don't have much knowledge to scripting so I need a helping hand. Basically, I want a sound to play once a BoolValue is triggered. Here's an example (Note that the BoolValue works fine and it's named "Chasing" and the sound I want to play is located at game.Workspace.Monster6.HumanoidRootPart.footsteps2)
**script.Parent.Chasing.Changed:Connect(function() if script.Parent.Chasing.Value == true then
local sound = game.Workspace.Monster6.HumanoidRootPart.footsteps2)
sound:Play()
**
Try this: script.Parent.Chasing.Changed:Connect(function() if script.Parent.Chasing.Value == true then
game.Workspace.Monster6.HumanoidRootPart.footsteps2:Play()
or
script.Parent.Chasing.Changed:Connect(function() if script.Parent.Chasing.Value == true then
workspace.Monster6.HumanoidRootPart.footsteps2:Play()
ok. Please use a code block next time you're including code in your question to make it readable.
Firstly, you create a variable to the path of the boolValue and of the sound:
local boolValue = --the path to the bool value local sound = --the path to the sound you want to play
Next, you create an event to detect change in the boolValue's value:
local boolValue = --the path to the bool value local sound = --the path to the sound you want to play boolValue:GetPropertyChangedSignal("Value"):Connect(function() if boolValue.Value then sound.Value:Play() end end)
I dont know why ur code isn't working, maybe mine will. GL