Here is the script i am trying to write.
local Humanoid = script.Parent.Humanoid function PwntX_X() 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.Robux.Value = Leaderstats.Robux.Value + math.random(1,5) wait(0.1) script:remove() end end end end Humanoid.Died:connect(PwntX_X)
Does anyone know why it is not working??? Please leave an answer ;)
Leaderstats are stored inside the player, not the humanoid. I'll fix the script, just use this instead.
local Humanoid = script.Parent.Humanoid function PwntX_X() local tag = Humanoid:FindFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent) local Leaderstats = player:WaitForChild("leaderstats") if Leaderstats ~= nil then Leaderstats.Robux.Value = Leaderstats.Robux.Value + math.random(1,5) wait(0.1) script:Destroy() end end end end Humanoid.Died:connect(PwntX_X)
Your trying to find leaderstats in a Humanoid try using game.players.LocalPlayers.leaderstats.Robux.Value instead of humanoid. But also does it show any error in the output?