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

How do i award players points after a Game Round?

Asked by 10 years ago

I want to award players Leaderboard Points after each round if they didnt die during the round? Ive tried so many things but they didnt work! Please Help!

Heres the game script with the Points awarder that doesnt work:

local base = game.Workspace.Lobby.Base
local victory = game.Workspace.Victory
local song = game.Workspace.OneWingedAngel

while true do

local MapTable = {
    game.Lighting.City;
    game.Lighting.Suburbs;
    game.Lighting.Boss
}
local Map = MapTable[math.random(1,#MapTable)]
wait(10)
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = ("The Map chosen for this round is the "..Map.Name)
local backup = Map:clone()
wait(5)
m.Text = "Loading Map"
wait(5)
m:remove()
Map.Parent = game.Workspace
Map:makeJoints()
wait(1)
base.CanCollide = false
wait(2)
base.CanCollide = true
song:play()
wait(120) 
    Died = game.Players.Player.Instance.new('boolvalue')  --starts here

game.Players.Player.Character.Died:connect(died)
Died = true

if Died == false then
game.Players.Player.leaderstats.Wins = game.Players.Player.leaderstats.Wins + 1 -- ends here
end
song:stop()

local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Round Over!"
victory:play()
wait(5)

victory:stop()

m:remove()


            Map:remove()



    Map = backup:clone()
    Map:makeJoints()
    Map.Parent = game.Lighting


end

0
It's easier if you provide the code for this, so we can edit it. lomo0987 250 — 10y
0
i just put it there for you theamazemanII 32 — 10y

2 answers

Log in to vote
0
Answered by
Vrakos 109
10 years ago

No, Tochi is correct.

You're trying to increase a value. Therefore, you need to define the value. You're almost there with it though.

game.Players.Player.leaderstats.Wins.Value = game.Players.Player.leaderstats.Wins.Value + 1
Ad
Log in to vote
-1
Answered by 10 years ago

Common Issue.

game.Players.Player.leaderstats.Wins.Value = game.Players.Player.leaderstats.Wins.Value + 1

You totally forgot the Wins.Value XD

0
nope theamazemanII 32 — 10y
0
welp im too lazy to sort it out XD TochiWasHere 10 — 10y

Answer this question