Fixed. thank you>

Hello,

Straight to it:

When a part, with text GUI saying “…” and when the part with that text touches another part, it will make a sound.

!!!THE SCRIPT WILL BE PLACED INSIDE THE MODEL / TEXT GUI NOT THE PART THAT YOU TOUCH!!!

I need help, because i have tried many things, searched it up, but nothing works!

Sincerely,
Milk.

2 Likes
script.Parent.Touched:Connect(function(touch)
    if touch.Parent.Name = "..." then
       -- play sound
   end
end)
2 Likes

It could work but its hard, thats not what i was searching for,

Now what you sent is good, but when the bus itself touches it, it makes the sound,
I need it to be a TextGUI that is inside my bus when that touches it with the text inside the GUI saying “…”, then it makes the sound.

1 Like
local WokrspaceService = game:GetService("Workspace")
local Sound = WorkspaceService.Sound
script.Parent.Touched:Connect(function(touch)
    if  WorkspaceService.Bus.TextGui.Frame.TextLable.Text = "..." and touch then
       Sound:Play()
   end
end)
1 Like

Still not working for me,

Its cause when i put the bus there are multiple different named, so is there a way if i put the script inside the bus where the textGUI is located?

1 Like

ok then put it into TextGui

local WorkspaceService = game:GetService("Workspace")
local Sound = WorkspaceService.Sound
WorkspaceService.PartNeedToTouch.Touched:Connect(function(touch)
    if  script.Parent.Gui.Text.Text ==  "..." and touch.Name == "PartThatNeedToTouchWithAnotherPart" then 
       Sound:Play()
   end
end)

Can you show me explorer with bus and textgui?

Ok, i edited it. I think it will work. Instead PartNeedToTouch and PartThatNeedToTouchWithAnotherPart use names of first and second part.

Just a heads up.
To play sounds you’ll need to use sound service,
and sound service uses local scripts…

Is it work? If yes pls make it solution.

The bus is inside the Workspace.

It’s not working, no errors.

I changed the script a little cause there was some mistakes.

add debounces too!

2391913991329139

bro why you changed text to “Szerelore var”? You sayed when text will be … and part touch another part then it play sound and i edited script again, it is better to use GetService() instead workspace i can test it now.I edited script again now it must work correct. Yes it work but here is better way because when it touch again sound will play again and it will be chaos because the same sound will play in one time.But idk how to make distance for sound.Here is code with better way:

local WorkspaceService = game:GetService("Workspace")
local Sound = WorkspaceService.Sound
local CanTouch = true
function touchedPart(touch)
	if CanTouch == true then
		if  script.Parent.Gui.Text.Text == "..." and touch.Name == "PartThatNeedToTouchWithAnotherPart" then
			Sound:Play()
			CanTouch = false	
		end
	end
end
function SoundEnded()
	CanTouch = true
end
WorkspaceService.PartNeedToTouch.Touched:Connect(touchedPart)
Sound.Ended:Connect(SoundEnded)

Can you show where is sound in explorer and parts that will touch in explorer too?
Video how it works(sorry for bad quality and the video is a little behind the sound):

In this video you can see this work only when sound ended and when text is …

If it helped pls mark it as solution

It’s not working for me, could you join me in studio to help me please?

Ok, can you now?Also add me to friends then.When can i help you?

Can you show location of sound and two parts that will touch in explorer?

I added you. Message me on Roblox or rukucc#8861