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

How would I access Stats via Script?

Asked by
IcyEvil 260 Moderation Voter
10 years ago

Im wanting to make a command that resets stats but I need to know how, Can someone give an example?

1 answer

Log in to vote
0
Answered by
DevWork 80
10 years ago

Well, try having a look inside an admin script. Some of them have a command which resets stats. Just like this one I found.

if msg:lower():sub(1,11) == "resetstats " then
local plrz = GetPlr(plr, msg:lower():sub(12))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
if v and v:findFirstChild("leaderstats") then
for a, q in pairs(v.leaderstats:children()) do
if q:IsA("IntValue") then q.Value = 0 end
end
end
end))
end
end
Ad

Answer this question