Why cant it find the sounds
Why cant it find the sounds
Sounds are added during runtime to the character, so if you try to find them as soon as the character is added (e.g. CharacterAdded
), you will likely find that they have not fully loaded in.
this script runs late after the character loads
Can you show your code? Can’t do much with just a few pictures.
all it is is detecting if the player touched a part, then tryign to play a sound
it ll works besides playing the sound
Yeah, we cant really help you much if we don’t know how your script is doing what it’s doing, yknow…
local Touchers = {}
script.Parent.Touched:Connect(function(P)
if P.Parent:FindFirstChild("Humanoid") then
if not table.find(Touchers, P.Parent) then
table.insert(Touchers, P.Parent)
end
end
end)
script.Parent.TouchEnded:Connect(function(P)
if P.Parent:FindFirstChild("Humanoid") then
if table.find(Touchers, P.Parent) then
table.remove(Touchers, table.find(Touchers, P.Parent))
end
end
end)
while task.wait(1) do
print(Touchers)
for _, V in Touchers do
print(V.HumanoidRootPart:GetChildren())
end
end
This returns this: