Is there a more efficient way to execute this besides disabling and re-enabling the script?
local EnterButton = script.Parent.EnterButton local XBox = tonumber(script.Parent.XBox.Text) local YBox = tonumber(script.Parent.YBox.Text) local ZBox = tonumber(script.Parent.ZBox.Text) function move() script.Disabled = true script.Disabled = false workspace.Part11.CFrame = CFrame.new(XBox, YBox, ZBox) end EnterButton.MouseButton1Down:connect(move)
Move the variables at the beginning of the script into the function. That way, whenever the function is called, the variables are refreshed, like so:
local EnterButton = script.Parent.EnterButton function move() local XBox = tonumber(script.Parent.XBox.Text) local YBox = tonumber(script.Parent.YBox.Text) local ZBox = tonumber(script.Parent.ZBox.Text) game.Workspace.Part11.CFrame = CFrame.new(XBox, YBox, ZBox) end EnterButton.MouseButton1Down:connect(move)
Hope this helped!