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

How do I make this give the player an item?

Asked by 8 years ago

So one of my scripters created a script so the player would get an item for owning a gamepass, he must have misunderstood me since I asked if the player could get an item for owning a badge. I tried tampering with it a bit and it still doesn't work, any help? Ty

01thingtoownid = 660386043 --thing to own
02item = "keyblade" -- item to clone from the replicated storages
03multipleitems = false -- if set to true then the format of the table below  MUST be [nameofgear = "id1", nameofgear =  "id2", ['adding a space'] = "id3"] for thing to own
04multiple = {['Springtime Basket'] = "id", goldcoil = "id", ownerbasket = "id"} -- this was made for less clutter
05 
06 
07 
08repeat wait() until script.Parent.Parent.Backpack
09plr = script.Parent.Parent
10if multipleitems == false then
11 
12 
13items = game.ReplicatedStorage:FindFirstChild(item)
14if items and type(thingtoownid) == "number" then
15 
View all 45 lines...
0
Just a note, I only edited the top half of the script since the bottom half is only used if the variable at the top is true. Skepticlemon 24 — 8y
0
What is output saying? Also where is the script located? Tempestatem 884 — 8y

1 answer

Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
8 years ago
Edited 8 years ago

Dictionary style tables

MarketplaceService/PlayerOwnsAsset

01-- Put in a LocalScript in StarterPlayerScripts or StarterGui
02-- Put whatever items you're awarding in ReplicatedStorage
03 
04-- Name of the gear in ReplicatedStorage = your assetId
05local gear = {['gear1'] = 419231331, ['gear2'] = 419231331, ['gear3'] = 419231331}
06 
07while true do
08    if game.Players.LocalPlayer then
09        if game.Players.LocalPlayer.Character then
10            break
11        end
12    end
13    wait()
14end
15 
View all 69 lines...
0
Thanks! Skepticlemon 24 — 8y
Ad

Answer this question