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

how to make it where an instance is only created once if the same child name? [closed]

Asked by 8 years ago
local Weapons = game.Players.LocalPlayer.Data:WaitForChild("Inventory").Weapons:GetChildren()
             number = 0
             children = #Weapons


            for  i = 1, #Weapons do

    local new = Instance.new("TextLabel")
                new.Parent = script.Parent
                new.Position = position + UDim2.new(0,0,0,30)
                position = position + UDim2.new(0,0,0,25)
                new.Size = UDim2.new(0,200,0,10)
                new.ZIndex = 2
                new.BackgroundTransparency = 1
                new.FontSize = "Size18"
                new.Font = "SourceSans"
                new.TextXAlignment = "Left"
                new.Text = Weapons[i].Name

This is what i dont want it to do

2
What exactly are you trying to do? You need to explain the problem in proper English (or at least in decent attempt of) to explain the issue and what you want fixed. "This is what i dont want it to do" doesn't necessarily help. M39a9am3R 3210 — 8y
0
well you're an idiot then. learn to read the title AwesomeSauce666556 0 — 8y
1
please tab your code correctly and supply both more information and any error(s) you may be receiving. Async_io 908 — 8y
0
We're not idiots, you didn't supply with enough information so we cannot help you. Calling us idiots won't help you at all. Async_io 908 — 8y
View all comments (2 more)
0
im just gonna ask it again with the same thing because i cant explain it any better then what the title said AwesomeSauce666556 0 — 8y
0
Dear AwesomeSauce666556, Your question has been locked as Non Descriptive as you have not supplied sufficient details pertaining to your question and adequate attempt of defining the problem and what you have attempted to do to solve it. Please review the tips I have provided you via Private Message as a baseline of the information we may need to solve your problem. M39a9am3R 3210 — 8y

Closed as Non-Descriptive by Async_io and M39a9am3R

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?