Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't the sound playing the first time equipped?

Asked by
asadefa 55
5 years ago

I am making a sword and I want an unsheath sound

Server script unsheath code:

EquippedEvent.OnServerEvent:Connect(function(player, Tool)
    Tool.Blade.Unsheath:Play()
    local hasSword = "user_"..player.userId.."_hasSword"
    --[[if database:GetAsync(hasSword) ~= true then 
        database:SetAsync(hasSword, true)
    end]]
end)

local script:

script.Parent.Equipped:Connect(function()
    EquippedEvent:FireServer(TOOL)
end)

It does not play the first time equipped but does afterward. How do I fix and why is this happening to me?

0
You're letting the client decide when to save data? That's never a good practice. User#25115 0 — 5y
0
Where asadefa 55 — 5y

Answer this question