Basically I want that when I kill a monster, and you have my double money gamepass, it gives you the double money when you kill a monster. I have tried many different alternatives but it comes to no solution, pls help me
This is the code I have tried that is inside the zombie model and is a script not local script
local Humanoid = script.Parent.Humanoid
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local id = --gamepass id not sharing
function died()
local ms = game:GetService("MarketplaceService")
local haspass = ms:UserOwnsGamePassAsync(Player.Userid, id)
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.Cash.Value = Leaderstats.Cash.Value +50
wait(0.1)
script.remove()
end
end
end
end
end
end)
Humanoid.Died:Connect(died)

2 comments
I cant thank you enough! Im a small dev but im still learning. Thank you thank you thank you!!
np, it's not that hard :D