game.Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = Player
local cash = Instance.new("IntValue")
cash.Parent = leaderstats
cash.Name = "Cash"
end)
game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("Folder", plr)
stats.Name = "leaderstats"
local kills = Instance.new("IntValue", stats)
kills.Name = "Kills"
end)
#Hi, pls help me i need add "Cash" in leaderboard if i kill player
88 messages · Page 1 of 1 (latest)
sry
** You are now Level 1! **
no
i change code
game.Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = Player
local cash = Instance.new("IntValue")
cash.Parent = leaderstats
cash.Name = "Cash"
local kills = Instance.new("IntValue", leaderstats)
kills.Name = "Kills"
end)
it's work but kill's don't work
how does someone get a kill
@lost crow ?
how to kill someone in your game
create another script for the kill system
???
you need a script to know if someone kills you
you can send?
im trying to do something not sure if it wokrs
np
wait you want to get money when you kill player or when to money on the ground
get money when you kill player
you have a script that drops money right?
yes
do you want to use money or kills
local char = script.Parent
local human = char:WaitForChild("Humanoid")
local humanRoot = char:WaitForChild("HumanoidRootPart")
local cash = game.ReplicatedStorage:WaitForChild("Cash")
human.Died:Connect((function()
local moneyDropped = math.random(10,30)
local cashClone = cash:Clone()
cashClone.BillboardGui.amountOfCash.Value = moneyDropped
cashClone.BillboardGui.amount.Text = "$" .. tostring(moneyDropped)
cashClone.Parent = game.workspace
cashClone.CFrame = humanRoot.CFrame + (humanRoot.CFrame.LookVector + Vector3.new(3,3,3))
end))
kills only for stats, money for shop and another idea's
local humanoid, killer,killerplr
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
plr.Character.Humanoid.Died:Connect(function()
humanoid = plr.Character:WaitForChild("Humanoid")
killer = humanoid:FindFirstChild("creator")
if killer then
killerplr = game.Players:FindFirstChild(killer.Value.Name)
killerplr.leaderstats.Cash += 100 -- whatever cash you wanna add
killerplr.leaderstats.Kills += 1
)
)
)
)
maybe this will work
** You are now Level 11! **
took so long
not work
** You are now Level 2! **
did you get any error?
did you test it in a player?
i dont think it would work on npc
did you test it on player?
yes
hmmm
?
oh yes?!
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
plr.Character.Humanoid.Died:Connect(function()
local humanoid = plr.Character:WaitForChild("Humanoid")
local killer = humanoid:FindFirstChild("creator")
if killer then
local killerplr = game.Players:FindFirstChild(killer.Value.Name)
killerplr.leaderstats.Cash += 100 -- whatever cash you wanna add
killerplr.leaderstats.Kills += 1
end
)
)
)
he used ) rather than end
lol
try this
i think you can put it workspace
did you try it on npc or player?
did you get any error?
what did you name the script?
moneyrain
** You are now Level 3! **
dumb me
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
plr.Character.Humanoid.Died:Connect(function()
local humanoid = plr.Character:WaitForChild("Humanoid")
local killer = humanoid:FindFirstChild("creator")
if killer then
local killerplr = game.Players:FindFirstChild(killer.Value.Name)
killerplr.leaderstats.Cash += 100 -- whatever cash you wanna add
killerplr.leaderstats.Kills += 1
end
end)
end)
end)
try this
why
how i can do it?
copy it and paste it here
k