I believe I have completed the script. I'll post it here because I believe all of you who helped me deserve to know how to make the same thing for your games. Enjoy!
Model Structure Below...
-Game
--StarterGui
---ScreenGui <-- ScreenGui
---PartDetector <-- LocalScript
---Sound <-- Audio
---CopyName <-- LocalScript
---NVAL <-- StringValue
Also a large part in Workspace that is transparent, anchored, and collisions turned off.
---PartDetector LocalScript---
local event
local Aname = script.Parent.NVAL
while true do
wait(5)
event = game.Workspace.Part.Touched:connect(function(t)
if t.Parent.Name == Aname.Value then
if script.Parent.Sound.IsPlaying == true then
event:disconnect()
end
if t.Parent.Name == Aname.Value then
if script.Parent.Sound.IsPlaying == false then
script.Parent.Sound:Play()
event:disconnect()
end
end
end
end)
end
---CopyName LocalScript Below---
local P = script.Parent.Parent.Parent
local V = script.Parent.NVAL
V.Value = P.Name
script:Destroy() |