Double Money if Someone has VIP Gamepass Problem

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)

Use MarketplaceService to check if player owns gamepass and if so *2 the amount.
Here: MarketplaceService | Documentation - Roblox Creator Hub

1 Like

alright thanks, let me try this real quick

I got it to work, thanks for your help!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.