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

Would this point script work?

Asked by 8 years ago

The Goal

I need to give the people who survived in a minigame points

How do I do this? Like this?

for _,v in next,alivePlayers do
    local leaderstats = v:FindFirstChild("leaderstats")
    local score = leaderstats:FindFirstChild("Points")
    score.Value = +15
end

Tell me if this is right or wrong. Thanks for your service!

Head of The AWESOME Gamers Group

PickUpTheBeat1

1 answer

Log in to vote
1
Answered by 8 years ago

You have it right, but the part where you add points is wrong. To do any form of mathematical formula, you first need to specify what you are adding on to. So:

score.Value = score.Value + 15

Also, I would recommend making a variable that specifies how much, simply for effeciency.

local PointsToAdd = 15
0
Thanks dude. NeonicPlasma 181 — 8y
0
I'm not right. I tested it and and error said: 17:54:49.111 - Workspace.Script:41: bad argument #1 to '(for generator)' (table expected, got nil) NeonicPlasma 181 — 8y
0
Send me entire script, I will have a look. I expect it will be a syntax error in your script, since nothing in mine are wrong. TheDeadlyPanther 2460 — 8y
0
Dude, solved it already! Got it! NeonicPlasma 181 — 8y
0
Good for you :) TheDeadlyPanther 2460 — 8y
Ad

Answer this question