Heyy, I’m trying to make a function to create a tween. The player creates two parts and names them as he wants then the player writes which part will be with the touched function and the other part will play the tween when the player touched the first part. In the video I showed what happens and what is the error:
I will be grateful for your help. Here is the script:
IdTouch.FocusLost:Connect(function()
for _, v in pairs(workspace:WaitForChild("Parts"):WaitForChild(game.Players.LocalPlayer.Name.."_s folder"):GetChildren()) do
if v:IsA("Part") then
if IdTouch.Text == v.Name and TweenId.Text ~= v.Name then
table.insert(TouchTable, v)
else
TouchTable = {}
end
end
end
end)
TweenId.FocusLost:Connect(function()
for _, v in pairs(workspace:WaitForChild("Parts"):WaitForChild(game.Players.LocalPlayer.Name.."_s folder"):GetChildren()) do
if v:IsA("Part") then
if TweenId.Text == v.Name and IdTouch.Text ~= v.Name then
table.insert(TweenTable, v)
else
TweenTable = {}
end
end
end
end)