onTouch script not working

I was scripting this simple onTouch script and it doesn’t do anything. Is there a fix?

function onTouch(part) 
	workspace.bobb.Head.billboard.text.Text = "Hello"
	wait(6)
	workspace.bobb:Destroy()
	wait(40)
	game.Lighting.TimeOfDay = 2
	wait(10)
	game.ReplicatedStorage.glue.Parent = workspace
	workspace.glue.Partb.Sound:Play()
end

script.Parent.Touched:connect(onTouch)

Huh- whaaa? For starters, if you want to play a sound you have to do this:

workspace.glue.Partb.Sound:Play()
1 Like

If bobb is already gone by the time your there, that means you should filter to make sure that what touched your part is actually a character.

1 Like