Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make several players use their money together?

Asked by 8 years ago

SO I use the basic leaderboard provided by tycoon starter kits, next, I changed it to ZKills (instead of Cash) and fixed everything to make it work, so yes, it does work, but, I want all players to be able to use the kills they've accumulated as a team. How do I do that?

I have no idea how to do it and I can't find it on roblox wiki. If it helps, here is the leaderboard script.

function onPlayerEntered(newPlayer) 
    wait(.5) 
    local stats = Instance.new("IntValue") 
    stats.Name = "leaderstats"
    local cash = Instance.new("IntValue")

    cash.Name = "ZKills" 
    cash.Value = 0      -- starting cash 

    cash.Parent = stats 
    stats.Parent = newPlayer 
end 

game.Players.ChildAdded:connect(onPlayerEntered) 

What I mean by everybody sharing money is, for example: When you are in a game and it has the leaderboard and everybodies stats combined show at the top of the leaderboard where the stat is named. I want to use that number, the combined number of everybodies stats.

1 answer

Log in to vote
1
Answered by 8 years ago

You could add an IntValue to the workspace and everytime Zkills goes up with any player it is added to the IntValue, that way all the players Zkills would go up together.

You could use this IntValue to create a ScreenGui showing the Total ZKills.

I hope i have understood what you were asking and i hope this helps.

Ad

Answer this question