You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
i want to get a number from a bar ive made
What is the issue? Include screenshots / videos if possible!
I dont know where to start
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
ive looked for solutions on the dev hub
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
I just need a point to launch of please do not give it to me because i m a new game dev learning to make games! here is my Janky script to make it move
local ButtonUp = false
local STOP = false
local FirtUp = true
script.Parent.MouseButton1Down:Connect(function()
if ButtonUp == false then
ButtonUp = true
else
STOP = true
end
end)
script.Parent.MouseButton1Click:Connect(function()
repeat
if FirtUp == false then
if STOP == false then
repeat
wait(0.04)
script.Parent.Parent.PowerDisplay.Position = script.Parent.Parent.PowerDisplay.Position - UDim2.new(0.015,0,0,0)
until script.Parent.Parent.PowerDisplay.Position.X.Scale < 0.49841707944869995 or STOP == true
script.Parent.Spin.Value = script.Parent.Spin.Value - 5
end
else
FirtUp = false
end
if STOP == false then
repeat
wait(0.04)
script.Parent.Parent.PowerDisplay.Position = script.Parent.Parent.PowerDisplay.Position - UDim2.new(0.015,0,0,0)
until script.Parent.Parent.PowerDisplay.Position.X.Scale < 0.35112607479 or STOP == true
end
if STOP == false then
repeat
wait(0.04)
script.Parent.Parent.PowerDisplay.Position = script.Parent.Parent.PowerDisplay.Position + UDim2.new(0.015,0,0,0)
until script.Parent.Parent.PowerDisplay.Position.X.Scale > 0.36040225625 or STOP == true
end
if STOP == false then
repeat
wait(0.04)
script.Parent.Parent.PowerDisplay.Position = script.Parent.Parent.PowerDisplay.Position + UDim2.new(0.015,0,0,0)
until script.Parent.Parent.PowerDisplay.Position.X.Scale > 0.6509760022163 or STOP == true
end
if STOP == true then
print(script.Parent.Spin.Value)
end
wait()
until STOP == true
end)
i want the number in the place that says Spin
the bar when you click it starts moving side to side and when you stop it i want the number from where i stoped it
here is a pick the black square moves
Thanks for any help again please just give me a place to jump off not a script
Thank you so much! thats a big help and script.Parent.parent.Powerdisplay.Position.X.Scale should work
for the button thanks so much again your a life saver
im gona go hop into studio and see if i can get it to work
Thanks so much it works 1 thing whats it the difference between P = Whatever and local P = Whatever
besides that im new how would i mark the solution and is there a way i could give you like a good rating or something you gave just enuff for me to get it witch is what i wanted! (This is my fist topic btw.)
I only said P = equation in the message to demonstrate an equation and what it could return.
For your case, in your code it would be preferably you define it as a local variable just so the different threads don’t get confused on which P is assigned to them.
That is if you need a variable for it. If not, you could just directly insert the equation (e.g., label.Text = equation).
I’m not sure if I explained that well, and I think you’re asking about something else so here’s another quick explanation.
for _ = 1, 10 do
print(P)
P = math.random(1, 10)
end
for _ = 1, 10 do
print(P)
local P = math.random(1, 10)
end
You’ll notice that the code #1 first prints nil then prints random while in the 2nd it’s always nil. local variables are only able to be accessed within their scope (essentially in their indented area).
Nice first post btw. You could just press that Solution button next to the heart button. It should look like this.
I appreciate the thought of you giving me a Solution.