I am trying to fire the remote event "PlayAudioLocal" in my server script but I get the error: Unable to cast value to Object
Server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local playAudio = ReplicatedStorage:WaitForChild("Remotes"):FindFirstChild("PlayAudioLocal")
playAudio:FireClient("PurchaseComplete")
Local
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local playAudioLocal = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("PlayAudioLocal")
local audio = ReplicatedStorage:WaitForChild("Audio")
playAudioLocal.OnClientEvent:Connect(function(name)
print("Fired")
if audio:FindFirstChild(name) then
audio[name]:Play()
else
warn("Could not find " .. name .. " in ReplicatedStorage/Audio")
end
end)
