A sound isn't playing when I step on the block meant to trigger it. There aren't any output errors, and experimental mode is on so filtering enabled shouldn't be a problem. Here's the code. EDIT: It works in studio just not online
local part = script.Parent local players = game:GetService("Players") local played = false part.Touched:connect(function(hit) local char = hit.Parent if char.Humanoid and played == false then local plr = players:WaitForChild(char.Name) plr.PlayerGui.Sounds.windows:Play() played = true wait(5) end end)
First make a sound in the Workspace, Next change the sound properties to your desire. Paste this code in the same script: And then change "SOUND" to the name of the object.
local part = script.Parent local players = game:GetService("Players") local played = false
part.Touched:connect(function(hit) local char = hit.Parent if char.Humanoid and played == false then local plr = players:WaitForChild(char.Name) game.Workspace.SOUND:Play() played = true wait(5) end end) -- If This Is Used In A Free Model | CREDIT ME! -- It Is Rude To Delete This Line -- -- Made By minecraftisawsome17 --