game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:FirstFindChild("Humanoid")
if humanoid then
if humanoid.RigType == Enum.HumanoidRigType.R6 then
local clone = game.ServerStorage:WaitForChild("R6Sword"):Clone()
clone.Parent = player.Character
elseif humanoid.RigType == Enum.HumanoidRigType.R15 then
local clone = game.ServerStorage:WaitForChild("R15Sword"):Clone()
clone.Parent = player.Character
end
end
character.Humanoid.Die:Connect(function()
local tag = character.Humanoid:FirstFindChild("creator")
if tag ~= nil then
local player = tag.Value
local expVal = 75
local exp = player:WaitForChild("Exp")
exp.Value = exp.Value + expVal
end
end)
end)
end)
I was wondering why I was getting this error code on this script.

1 comment
I misread the title as FindFirstChild instead of FirstFindChild