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

Help making money gui that changes value everytime a zombie is killed?

This script doesn't change the value of the money.

local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local leaderboard = player:WaitForChild("Leaderboard")
local money = leaderboard.Money
local value = script.Parent

value.Text = money.Value

money:GetPropertyChangedSignal("Value"):Connect(function()
	value.Text = money.Value
end)


local hum = game.ReplicatedStorage("Drooling Zombie"):WaitForChild("Humanoid")
hum.Died:Connect(function()
	game.ServerStorage.givemoney:Fire(15,money.Value)
end)

2 comments

0

You might be able to store a value of how many zombies have been spawned, and when one is killed, +$ to the money value? Not quite sure but I hope it helps a little!

0

u dont need to use server for give player money some of roblox contents will change for all players like player position or leaderstats

1 answer

This line here is a problem.

local Leaderboard = player:WaitForChild("Leaderboard")

Leaderboard should be leaderstats. I'll have the line thats mostly correct if your folder name is leaderstats, but this is a way to add the folder.

Instance.New("Folder")

The Folder name will change if there is something naming it. Now, to the fixed error.

local Leaderboard = player:WaitForChild("leaderstats")

Possibly a scripting error or name switching.

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