So I've been trying to make this shouting simulator game with a friend of mine and we both seem stumped (yet again) with this error. Note that this script is a server script and not a local or module
These are the pieces of code in question;
local function shout(points,shout,plr)
addPoints(points,plr)
local chr = plr.Character
local sound = chr:WaitForChild("Head"):WaitForChild("Shout")
sound.SoundId = shout
sound:Play()
end
rs.Events.Shouted.Event:Connect(function(points,shout,plr)
print(points)
print(shout)
print(plr)
shout(points,shout,plr) -- This line is where the error comes from
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(chr)
local shoutSound = Instance.new("Sound")
shoutSound.Name = "Shout"
shoutSound.Parent = chr:WaitForChild("Head")
end)
end)
It says the error is on line 40 of the code (which I have specified in the code blocks) and I'm not sure where it's coming from.
