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

How to set Adornee to part that require Combined string.?

Asked by 3 years ago

Plz Halp!1! :(

local RepStor = game:GetService("ReplicatedStorage")

local Player = game.Players.LocalPlayer
for i = 1, 3, 1 do
    local Gui = RepStor.SurfaceGui:Clone()
    Gui.Parent = Player.PlayerGui
    Gui.Adornee = game.Workspace.Object.Part .. i
end

so I'm trying to set Adornee via using index of the for loop. I Tried to combine but no solution. There is error message says : Part is not valid member of Model. There is Part Names in Model: Part1 Part2 Part3

How do I solve this?

1 answer

Log in to vote
0
Answered by 3 years ago

You should put:

Gui.Adornee = workspace.Object["Part"..i]
0
Uh, it works. But why we should put [] to Object? DhMrfuun 1 — 3y
0
because thats how we can obtain the string, we can't put Object."Part"..i because its a string and not an instance, if that makes sense AntoninFearless 622 — 3y
Ad

Answer this question