Roblox has the best guns for my purposes, only problem is that in their guns, there is no creator tag used, and because I'm quite new to scripting, I don't know how to add one in. rbxassetid://4842207161
this is one of the guns that im using, and i want to make a leaderboard, and i want to use creator tag for that.
this is leaderstat script im using
game.Players.PlayerAdded:Connect(function(player)
local LS = Instance.new("Folder")
LS.Name = "leaderstats"
LS.Parent = player
local kills = Instance.new("NumberValue")
kills.Name = "Kills"
kills.Parent = LS
kills.Value = 0
local cash = Instance.new("NumberValue")
cash.Parent = LS
cash.Value = 0
cash.Name = "Cash"
player.CharacterAdded:connect(function(character)
character.Humanoid.Died:connect(function()
local creator = character.Humanoid:FindFirstChild('creator')
local leaderstats = creator.Value:FindFirstChild('leaderstats')
if creator ~= nil and creator.Value ~= nil then
local cashAmount = 10
local killAmount = 1
game.ReplicatedStorage.RemoteEvents.VALUEEvent:FireClient(player)
leaderstats.Cash.Value = leaderstats.Cash.value + cashAmount
leaderstats.Kills.Value = leaderstats.Kills.value + killAmount
game.ReplicatedStorage.Values.KillsCounter = game.ReplicatedStorage.Values.KillCounter + 1
end
end)
end)
end)
