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

How do I change this script to only award the gear once ever? [closed]

Asked by 7 years ago

I have this gear which gives the person a gear if they have a badge:

badgeid = 468156809 -- id of badge needed
toolstorage = game.ServerStorage -- where to store the gear(s)
tools = {"[G] Alpha"} -- names of the tools (you can put as many as you want)

game.Workspace.ChildAdded:connect(function(c)
    if game.Players:GetPlayerFromCharacter(c) then
        p = game.Players:GetPlayerFromCharacter(c)
    else
        return
    end
    if game:GetService("BadgeService"):UserHasBadge(p.userId, badgeid) then
        for i,v in pairs(tools) do
        local clone = toolstorage:WaitForChild(v):Clone()
        clone.Parent = p.Backpack
        end
    end
end)

I was wondering how to change this to make it so the user can only obtain the gear ONCE, even if they rejoin the game, since gears will save when they leave.

0
How are you saving the players gear ? User#5423 17 — 7y
0
Don't just copy and paste scripts and ask us to add stuff to them. Please attempt the problem yourself first. OldPalHappy 1477 — 7y

Closed as Not Constructive by OldPalHappy

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?