this script isnt working idk why if someone can tell me where to put something. It has to work for only one team or is there easy was like do custom leaderstats or do it something else?
local DataStoreService = game:GetService("DataStoreService") local DataStore = DataStoreService:GetDataStore("ForceStats") -- Change this with a different name. local Player = game.Players
if Player.TeamColor ~= BrickColor.new("Sea green") then do
game.Players.PlayerAdded:Connect(function(Player) local Leaderstats = Instance.new("Folder", Player) Leaderstats.Name = "leaderstats" local Currency = Instance.new("IntValue", Leaderstats) Currency.Name = "Force" -- Change "Money" with your currency. Currency.Value = 1
local Data = DataStore:GetAsync(Player.UserId)
if Data then
Currency.Value = Data -- Change this if you have added more currencies.
end
end)
if Player.TeamColor ~= BrickColor.new("Sea green") then do
game.Players.PlayerRemoving:Connect(function(Player)
DataStore:SetAsync(Player.UserId, Player.leaderstats.Force.Value)
end)
end
end
end
end)
