I get this error FireClient: player argument must be a Player object idk how to fix it i've been trying but i cant seem to fix is i would appreciate if someone helps.
local Humanoid = script.Parent.Humanoid
function kill()
local Tag = Humanoid:findFirstChild("creator")
if Tag ~= nil then
if Tag.Value ~= nil then
local Leaderstats = Tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats.Souls.Value = Leaderstats.Souls.Value + 250 --Change Money to the stat that is increased.
local Player = game.Players:GetPlayerFromCharacter(Tag.Parent)
game.ReplicatedStorage.SoulsEvent:FireClient(Player)
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(kill)

1 comment
How do you accept the manual chore of deleting indentation that is specifically automated, for the central purpose of making readable code?