local function soundhit(part, exactpos)
local att = Instance.new("Attachment")
att.WorldPosition = exactpos
att.Parent = part
att.Name = "SoundHit"
local material = part.Material.Name
if hitfolder:FindFirstChild(material) then
local soundc = hitfolder:FindFirstChild(material):FindFirstChild("Sound1"):Clone()
soundc.Parent = att
soundc.Name = "Hit"
soundc:Play()
end
end
Doesn’t seem to play , I already checked volumes and I checked immediately when the script runs. It’s a server script for a gun system, the sounds are not moderated. It only clones the sound.
After it prints “Played” can you see in-game the sound in the attachment? Can you call the soundhit function outside of it’s parent function? What Pumpky said. Are you allowed to use that sound?
Can you get local function soundhit(part, exactpos)
function soundhit(part, exactpos)
by moving that function out of what function it is in?
Why is it local?