#get money foe killing a zombie
38 messages · Page 1 of 1 (latest)
step 2. send the formatted code
so instead of
if killer then
local player = killer.Value
player.leaderstats.cash.Value +=1
print("#z2")
end
you do:
if killer then
local player = killer.Value
player.leaderstats.cash.Value +=1
print("#z2")
end
pk
step 3. add comments on what ur code does.
if killer then
local player = killer.Value -- Defines a player value
player.leaderstats.cash.Value +=1
print("#z2")
end
THEN come back and ask ur question
?
i have absolutley no idea how this works
zombie.Died:Connect(function() -- if dies run script
local killer = zombie:FindFirstChild("Creator") -- defines the killer of the zombie
print("#z1")--prints
if killer then--if the zombie died by person
local player = killer.Value -- i have not clue
player.leaderstats.cash.Value +=1--give leader stat cash
print("#z2")--prints
end-- ends the if statment
end) -- ends the function
@steady frigate
he doesn't need to add comments 💀
ye but i like making people do more work just for me not to help them
speaking of me not helping ima head out
can you show your zombie
think*
in explorer
** You are now Level 1! **
so now what i do
idk
how to make the script know that there is a person who killed it
i think
you used this video
Sword used in this video: https://create.roblox.com/marketplace/asset/7028556002/Linked-Sword
In this video, I'll be showing you how you can make a Cash giver on-kill system. It is basically a system where you earn cash whenever you kill an NPC or Player. I will be using the linked sword for this tutorial since it will be very easy to utilize d...
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
name="Humanoid"
robo=script.Parent:clone()
humanoid.Died:Connect(function()
local killer = humanoid:FindFirstChild("creator") -- defines the killer of the zombie
print("#z1")--prints
if killer then--if the zombie died by person
local player = killer.Value -- defines the killer of the zombie
player.leaderstats.cash.Value +=1 --give leader stat cash
print("#z2")--prints
end-- ends the if statment
local robot=robo:clone()
robot.Parent=script.Parent.Parent
robot:makeJoints()
script.Parent:remove()
end)
done i got it