local part = script.Parent part.Touched:Connect(function(Hit) if…
- User
local part = script.Parent
part.Touched:Connect(function(Hit) if Hit.Parent:FindFirstChild("Humanoid") ~= nil then local sound = script.Parent.Soundname
if not sound.IsPlaying then sound:Play() end endend)
change script to part not player
- Assistant
It appears that the existing script is designed to play a sound attached to a
partwhen it is touched by a player's avatar (which has a "Humanoid" part). If you want to keep the functionality tied to the part itself and not require a player to cause the interaction, you could modify the script to use a different trigger than "Touched" or adjust the conditions within the Touched event.For clarity, the term "player" usually refers to the human controlling the avatar; in the original script, you are checking if the touched object (
Hit) has a "Humanoid," which is usually a characteristic of player avatars in Roblox.