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

Why do i get an error on the 5th line when making a new sound in the head?

Asked by
Plieax 66
6 years ago
local aplayerdied = game.ReplicatedStorage.playerhasdied


aplayerdied.OnServerEvent:connect (function(plr)
    local music = Instance.new("Sound",plr.Head)
    music.IsPlaying = true
    music.Playing = true
    music.SoundId = "rbxassetid://1321997558"
    music.Volume = 1
    music.MaxDistance = 100
    music.EmitterSize = 10
    wait "1"
    music:Destroy()
end)
1
Whats the error say? nicktooner 119 — 6y
0
^ Adding onto, if it's an error about something not loading, take this page into consideration too: http://wiki.roblox.com/index.php?title=Character (For when a scripts loads before the object's there) TheeDeathCaster 2368 — 6y
0
Just curious, but it seems like you made a function that runs when a player dies. Why would you need to use remote events for this when you can just use Humanoid.Died? User#20279 0 — 6y

Answer this question