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
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!