Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

You should put:

Gui.Adornee = workspace.Object["Part"..i]

2 comments

0

Uh, it works. But why we should put [] to Object?

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

This discussion is preserved as it was. New answers, comments, and votes are closed.