Cteche
(Cteche)
January 6, 2023, 4:47pm
#1
I am trying to make a script, That will give a player coins when he kills a player, And I have no clue please help.
game.Players.PlayerAdded:Connect(function(Player)
local Leaderstats = Instance.new("Folder")
Leaderstats.Parent = Player
Leaderstats.Name = "leaderstats"
local Currency = Instance.new("IntValue")
Currency.Parent = Player.leaderstats
Currency.Name = "Push Coins"
end)
2 Likes
The system that kills players must have a system in place to set attributes of the character, to say which players have contributed to their health being damaged. This can be used to make an assist system, and allow the contributors to get cash.
1 Like
Intencidy
(smelvin)
January 6, 2023, 5:43pm
#3
I would recommend looking through Roblox’s Classic Sword , its scripts, and other values to get a clue of how you may want to design your kill tracking system. Pretty sure the server script inside the sword has a way of tagging damaged players with the players that damage them.
1 Like
xDeltaXen
(xDeltaXen)
January 7, 2023, 6:23am
#4
local Players = game:GetService(‘Players’)
local function OnPlayerAdded(Player)
print(Player.Name … ‘Joined’)
end
local function OnPlayerAdded(Player)
print(Player.Name … ‘Left’)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
Players.PlayerRemoving:Connect(OnPlayerRemoved)
local Players = game:GetService(‘Players’)
local function OnPlayerAdded(Player)
print(Player.Name … ‘Joined’)
end
local function OnPlayerAdded(Player)
print(Player.Name … ‘Left’)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
Players.PlayerRemoving:Connect(OnPlayerRemoved)
local Players = game:GetService(‘Players’)
local function OnPlayerAdded(Player)
print(Player.Name … ‘Joined’)
end
local function OnPlayerAdded(Player)
print(Player.Name … ‘Left’)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
Players.PlayerRemoving:Connect(OnPlayerRemoved)
local Players = game:GetService(‘Players’)
local function OnPlayerAdded(Player)
print(Player.Name … ‘Joined’)
end
local function OnPlayerAdded(Player)
print(Player.Name … ‘Left’)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
Players.PlayerRemoving:Connect(OnPlayerRemoved)