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.
I laughed at this a bit. You misspelled FindFirstChild XDDDDDDD
Correct Script:
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local humanoid = character:FindFirstChild("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:FindFirstChild("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)