Hey guys,
I’m trying to double the amount of money you get when you kill an NPC if you have my VIP gamepass. I tried to look on YouTube but I couldn’t find anything and I can’t figure it out. If anyone could help me add to my code then please do!
Here is the script and the gamepass ID is “219495358”
local Humanoid = script.Parent.Humanoid
local plr = game.Players.LocalPlayer
local event = game:GetService("ReplicatedStorage").Remotes.Kill
local text = "Roamer"
function died()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
local amount = math.random(25, 50)
Leaderstats.Gold.Value = Leaderstats.Gold.Value + amount
Leaderstats.Kills.Value = Leaderstats.Kills.Value + 1
game.ReplicatedStorage.Values.Amount.Value = amount
game.ReplicatedStorage.Values.ZombieName.Value = text
game.ReplicatedStorage.Values.zombiesAlive.Value = game.ReplicatedStorage.Values.zombiesAlive.Value - 1
task.wait(5)
script.Parent:Destroy()
end
end
end
end
Humanoid.Died:connect(died)