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

Would This Work??

Asked by 10 years ago

What it should do is award a player point (If available) to the owner of a factory if he has upgraded everything.

if script.Parent.Factory.Grader1 == nil and script.Parent.Factory.Grader2 == nil then
    name = script.Parent.Factory.OwnerName.Value
    player = game.Players:FindFirstChild(name:tostring())
    h = game:GetService("PointsService")
    balance = h:GetAwardablePoints()
    if balance >= 1 then
        h:AwardPoints(player.userId, 1)
    end
end

I'm new to advanced scripting, so please help me improve :D

P.S If you have done any changes, please explain as best as you can in detail on what the script does, preferably line be line

1 answer

Log in to vote
0
Answered by 10 years ago

Yes it would work, but I don't think it'll work some times.

0
Great, thanks! fahmisack123 385 — 10y
Ad

Answer this question