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

can someone tell me if this works?

Asked by
mehssi 20
8 years ago

i cant test it myself so please help me its suppose to find out who has the highest hidden stat.Points.Value and gives that player 1 player point

local pts= workspace.points

pts.Changed:connect(function(prop)
    if pts.Value == true then
        print("works")
        local plrs={}
        local p={}
        for _,v in pairs(game.Players:GetPlayers()) do
            pcall(function() plrs[tostring(v.userId)]=v.hiddenstats.Points.Value
            table.insert(p,v.hiddenstats.Points.Value)
                    print("work2")
            end)
        end
        local m=math.max(unpack(p))
        for _,v in pairs(plrs) do
            if v==m then
                                        print("works3")
            pcall(function() game:GetService("PointsService"):AwardPoints(tonumber(1), 1) end)
            break
            end
        end
    end
end)
0
Why can't you just test this? groovydino 2 — 8y
0
#diy minikitkat 687 — 8y
0
It's 'game.Workspace', not 'workspace' TheDeadlyPanther 2460 — 8y
0
'workspace' works just fine. One does not have to refer to 'game.Workspace' DigitalVeer 1473 — 8y

Answer this question