while true do
wait(.25)
ray = Ray.new(Char.Head.Position,Vector3.new(0,1,0).unit*5000)
part = workspace:FindPartOnRayWithWhitelist(ray,whitelist,false)
AudioData = script:WaitForChild("AudioData")
if part ~= nil then
ray2 = Ray.new(part.Position,Vector3.new(0,1,0).unit*5000)
advpart = workspace:FindPartOnRayWithWhitelist(ray2,whitelist2,false)
The problem seems to lie in the ray variable. When the player dies and respawns, it stops updating the player's head's position. I need to figure out how to get it to continue updating so the script continues to cooperate. Probably an easy fix, but I'm still in new territory for myself.
