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

How do I award players with new gear?

Asked by 9 years ago

I want to award players with some new gear when they play lots, so it has some replay value. How do I do this? All the guides I can find are on Player Points, and I don't think that has any replay value.

1 answer

Log in to vote
2
Answered by 9 years ago

To award a player with a gear, you would basically Clone a gear into said players Backpack. Now, for them playing a lot, the only way I can think of this is using Data Stores and you're not exactly learning what to do by me scripting a Data Store script to keep track of playing for you. Although, here's a link to Data Stores on ROBLOX Wiki to show you how to use them.

With Data Stores, you can use the PlayerAdded event to add 1 to the value and at a certain amount, do a script that will check that value and if it's at what it must be, then you can do it. I'll make a script that will clone a tool named LinkedSword into the players backpack when they play, I'll pretend your Data Store is putting its value in a IntValue inside of the player as well.

(I'll use regular script, locals cannot access Data Stores!!)

game.Players.PlayerAdded:connect(function(plr)
    if plr.IntValue.Value == 10 then
        local Sword = game.ServerStorage:FindFirstChild("LinkedSword"):Clone()
        Sword.Parent = plr.Backpack
    else
        print(plr.Name.." Needs 10 plays to get this!")
    end
end)

There is probably another way, this is what came to mind.

Ad

Answer this question