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

Should I use the .died function because my script isn't working?

ZombieA gets spawned into workspace and inside ZombieA I changed humanoid to Zombie. This script is for when the Zombie dies, it doesn't matter if everyone where to get money because it's a 1 man server.

local Zombie = game.Workspace:FindFirstChild("ZombieA")
local player = game.Players

if Zombie.Zombie.Health >= 0 then
	player.RealMoney = player.RealMoney + 2
end

2 answers

Try this:

local Zombie = game.Workspace:FindFirstChild("ZombieA")
local player = game.Players.LocalPlayer

if Zombie.Zombie.Health == 0 then
    player.RealMoney = player.RealMoney + 2
end

1 comment

0

It didn't work is it ment to be a local script or in server script server .etc

local Zombie = game.Workspace:FindFirstChild("ZombieA")
local player = game.Players.Localplayer
Zombie.Zombie.Changed:Connect(function()
	if Zombie.Zombie.Health == 0 then
	    player.RealMoney.Value = player.RealMoney.Value + 2
	end
end)

2 comments

0

It didn't work is it ment to be a local script or in server script server .etc

0

Serverscript

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