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

Have i used ChildAdded: function correctly because this script dosen't work?

Asked by 4 years ago

"Zombie" is the zombie in workspace This script is for when the zombie dies money is given to the player I renamed the Humanoid in Zombie to Zombie

local char = script.Parent.Parent
local player = game.Players:GetPlayerFromCharacter(char)
local RealMoney = player:FindFirstChild("RealMoney")
local boost = player:FindFirstChild("CoinBoost")

workspace.ChildAdded:Connect(function(Zombie)
    if Zombie.Name == "Zombie" then
        Zombie:WaitForChild("Zombie").Died:Connect(function()
            player.RealMoney.Value = player.RealMoney.Value + 1000
        end)
    end
end)
0
ChildAdded is an event not a function. User#5423 17 — 4y
0
You should be chacking when damage is done to the zombie as you know who is doing the damage not when the zombie dies User#5423 17 — 4y
0
It is a 1 man server FluffySheep46209 369 — 4y

Answer this question