Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Positioning a brick using a GUI failing?

Asked by 9 years ago

So I have this thing I'm working on that relies on three text GUIs and one TextButton GUI. The point is to get numbers entered by the user into each of the three GUIs and transfer those over to XYZ positions and apply them to a block. However when the TextButton (EnterButton) is clicked the block just moves to 0, 0, 0. Any ideas on how to fix this?

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)

EnterButton.MouseButton1Down:connect(function()
    workspace.Part11.CFrame = CFrame.new(XBox, YBox, ZBox)
end)

Answer this question