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

I am making a gui and stuck with a script help?

I am new in lua so I made this script _G.mon = true -- false to stop while _G.mon do wait(2) for i,v in pairs(game.Workspace:GetChildren()) do str = v.Name if string.match(str, "[name.Text]") then game.Workspace:WaitForChild(game.Players.LocalPlayer.Character.Name).HumanoidRootPart.CFrame = v.HumanoidRootPart.CFrame end end end

the "name.text" part doesnt work name is the name of the textbox how can I change the "name.text" part to text in the box? like when you write players name somewhere it changes to that

1 comment

0

The code is unclear, please edit your post and use a code block instead of inline code, it's the rightmost option

1 answer

You are using :WaitForChild(), try :FindFirstChild(), like this

_G.mon = true
while _G.mon do
	wait(2)
	for i,v in pairs(game.Workspace:GetChildren())
		do str = v.Name
		if string.match(str, "[name.Text]") then
			game.Workspace:FindFirstChild(game.Players.LocalPlayer.Character.Name).HumanoidRootPart.CFrame = v.HumanoidRootPart.CFrame
		end
	end
end

Some of the script isn't showing properly, please click view source to see the full script Hope this helps!

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