Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would i make it if you die you drop money?

Would this work? or not?


for i,v in pairs(game.Players:GetChildren()) do
	if v.Health == 0 then
		a = game.Lighting.Money:clone()
		a.Main.CFrame = v.Charecter.Head.CFrame
		a.Main.Money.Value = v.leaderstatus.Money.Value
		a.Parent = game.Workspace
	end
end

1 comment

0

You just asked the same question before. Please do not spam your questions.

2 answers

✓ Accepted answer
game:GetService("Players").PlayerAdded:connect(function(p)
	p.CharacterAdded:connect(function(c)
		local hum = c:WaitForChild("Humanoid")
		hum.Died:connect(function()
			local a = game.Lighting.Money:Clone()
			a.Main.CFrame = c.Head.CFrame
			a.Main.Money.Value = p.leaderstats.Money.Value
			a.Parent = Workspace
		end)
	end)
end)

Try this.

for i,v in pairs(game.Players:GetChildren()) do
    v.Character.Humanoid.Died:connect(function()
        a = game.Lighting.Money:clone()
        a.Main.CFrame = v.Character.Head.CFrame
        a.Main.Money.Value = v.leaderstats.Money.Value
        a.Parent = Workspace
    end)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.