I just want to know what to do to make this actually move, I've pointed out where my confusion is.
while true do wait(1) Value = math.random(100,500) if script.Parent.Parent.Tool.Enabled == true then script.Parent.Position = (Value,Value) --Not sure how to format this end end
Edit
while true do wait(1) Value = math.random(100,500) if script.Parent.Parent.Tool.Enabled == true then script.Parent.Position = UDim2.new(0,Value,0,Value) end end
ANY Help is appreciated! Thanks!
UDim2's are the way GUI's position themself on-screen. They take scales and offsets. Scales are values from 0 to 1 while offsets can be anything as it gets the actual pixel distance. Don't do what chill did and make the scale over 1, otherwise the GUI won't even be on the screen.
while wait(1) Value = math.random(100,500) if script.Parent.Parent.Tool.Enabled == true then script.Parent.Position = UDim2.new(0,Value,0,Value) end end
You should use the UDim2 keyword, Just Like CFrame is used for moving Parts UDim2 is used for moving GUI's
script.Parent.Position =UDim2.new (Value, Value, Value, Value) -- Since there are 4 values in The Gui you have to input 4 values