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

So I'm trying to work with leaderstats values, how can i do it?

Asked by
R_ngar 10
6 years ago

Well, im trying to do an rpg game and in the leaderboard are three values: Power, Money and Magic. And every magic number is an element. Like 1 is fire, 2 is water, 3 is earth etc. . And here is the script that i was using, but it doesnt work! Im trying to do like:

if script.Parent.Parent.leaderstats.Magic.Value == 1 and script.Parent:findFirstChild("Fire") == nil then
         game.Lighting.Fire:clone().Parent = script.Parent
       end


But it doesnt work! Help!

0
'Doesnt work' is too broad H4X0MSYT 536 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
game.Players.PlayerAdded:connect(function(plr) -- player added
    local stats = Instance.new('IntValue',plr)
    stats.Name = 'leaderstats'

    local magic= Instance.new('StringValue',stats)
    magic.Name = "Magic" 
    magic.Value = "Earth"
end)

this leaderbord should work .

http://wiki.roblox.com/index.php?title=Leaderboard

this article will also help you under stand leaderbords a little bit to.

0
But I also want the others value, what can i do R_ngar 10 — 6y
0
you can create a GUI that will change the local players magic value so when the players enter they can chose there magic. TheScriptKing 102 — 6y
0
nah i have another plan, but thanks so much for the answer R_ngar 10 — 6y
0
np good with your game TheScriptKing 102 — 6y
Ad

Answer this question