#get money foe killing a zombie

38 messages · Page 1 of 1 (latest)

steady frigate
#

step 1. learn to format code

#

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
fresh seal
#

pk

steady frigate
#

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

fresh seal
#

?

steady frigate
#

i have absolutley no idea how this works

fresh seal
#
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

slate bough
steady frigate
#

speaking of me not helping ima head out

slate bough
#

@fresh seal what is the killer

#

?

#

string value ?

#

so it's string value

fresh seal
#

i think i dont really know

#

yea i this it just creator

slate bough
#

can you show your zombie

fresh seal
#

think*

slate bough
#

in explorer

fresh seal
verbal frigateBOT
#

studio** You are now Level 1! **studio

slate bough
#

i mean

#

inside zombie

fresh seal
slate bough
#

so here is nil

fresh seal
#

so now what i do

slate bough
#

idk

fresh seal
#

how to make the script know that there is a person who killed it

slate bough
#

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...

▶ Play video
fresh seal
# slate bough i think

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