Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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)

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! Dreadd15 4 — 3y
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 Ariya1234gamer 15 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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.

Ad

Answer this question