How to make a slider in Roblox Studio
HTML-код
- Опубликовано: 1 окт 2024
- This is a remake of a previous video with better editing and quality. There might be some inconsistencies as I slightly rushed this video. Also you can't really animate something like this alot.
In this video I show you how to make a slider user interface in Roblox Studio.
tags:
#roblox #robloxstudio #tutorial #animated #robloxgui #sliders #slidergui
I love it, you're not like the others who just give the code, you detail the code well and you explain why you have to do that, it's great
the slider can go past 0 or 100 :/
It would be a great video if it was not for the tts voice. It was a headache to listen to it, but the tutorial itself is useful.
I used the wrong one here. Going to use a better TTS next time. This is until I get a microphone.
You are going to have microphone. Gift from Baba😊😊😊 @@TaseenA09
It didnt bother me maybe im just used to it
@@TaseenA09elevenlabs bro
...@@1DontNoclip
STOP DOING MAGIC IN THE CODE AND SKIPPING STUFF I CANT FOLLOW and also can you do it slower but ty for the worlds hardest tutorial to follow :)
imagine i copy the script and it doesnt work XDDD
FINALLY.
a GREAT roblox studio tutorial!
i hope you get alot of attention from people dude
you deserve it for making these high quality tutors
Great Video, But for some reason the slider goes outside the bounds, probably a new studio update? Could you remaster this video?
That output breakdown at the start was really something.
I Love this tutorial so much, it has helped me ALOT, thank you.
Thank you so much! Very well explained, new sub! :)
Useful but it was fucking pain that voice, next timw use yours or different one
how would i incorporate music volume into this slider
THE BEST UI tutorial i'v ever seen
Very good tutorial of slider buttons!
This is a very very complicated tutorial, i would be able to follow, i dont think its not understandable, but its just me not being experienced enough to follow with understanding. Thank you, still got me inspired.
is it possible to make a slider in surfaceguis? i know there is a beta feature but i don’t want to wait until it comes out.
dont comment often but this is a good tutorial
W video man. Ive been wanting to learn this for years since i started coding. :3
Cool ! That’s an improved version of the tutorial that made me discover this channel
How do i make it do something?
the fastest, easiest, the best tutorial of a slider
As a dev myself, be proud of this video! You're doing what most others won't, and I will gladly subscribe and watch future videos!
1k likes
das smart, never knew sliders were this tuff to make
its going outside the slider
would've been so simple with roact-hooks
thank u so much
write me script pls
not sure abt it but mb for someone this way would be easier(btw great tutorial):
local front = script.Parent.Parent.Frame
local back = front.Parent
local isPressed = false
local mouse = game.Players.LocalPlayer:GetMouse()
script.Parent.MouseButton1Up:Connect(function()
isPressed = false
end)
script.Parent.MouseLeave:Connect(function()
isPressed = false
end)
script.Parent.MouseButton1Down:Connect(function(x,y)
isPressed = true
front.Size = UDim2.new((mouse.X - back.AbsolutePosition.X)/back.AbsoluteSize.X,0, 1,0)
script.Parent.Text = math.round((mouse.X - back.AbsolutePosition.X)/back.AbsoluteSize.X * 100) .."%"
end)
mouse.Move:Connect(function()
while isPressed do
wait()
if (mouse.X - back.AbsolutePosition.X) < 0 or (mouse.X - back.AbsolutePosition.X)/back.AbsoluteSize.X > 1 then continue end
front.Size = UDim2.new((mouse.X - back.AbsolutePosition.X)/back.AbsoluteSize.X,0, 1,0)
script.Parent.Text = math.round((mouse.X - back.AbsolutePosition.X)/back.AbsoluteSize.X * 100) .."%"
end
end)
This won't work if the mouse is outside the slider, making it harder to use.
yes, i wanted this don't work when mouse is ouside the slider, it was my goal, not sure if it's gonna be harder to use..@ot_140
can u give me the code pls
Mine doesn’t work
Man this is gonna be so useful, thank you so much dude
your so underrated this is the first time i found a tutorial this good
Oh! i'm your 250th sub! Congrats
Also the video was good! I was into making a simulator but i got a problem with sliders.
Great video. Im not a new programmer but I wanted to see your teaching type and it is decent for a semi rushed video. I hope you get the recognition deserved.
Mine can only be clicked, not slided what might i have done wrong?
local mouse = game.Players.LocalPlayer:GetMouse()
local slider = script.Parent
local fill = script.Parent.Fill
local trigger = script.Parent.Trigger
local outputValue = script.Parent.OutputValue
local outputLabel = script.Parent.Label
local maxValue = 1 or 100/100
local startingValue = 0 or 0/100
fill.Size = UDim2.fromScale(outputValue.Value,1)
outputLabel.Text = tostring(math.round(outputValue.Value*100))
local tweenService = game:GetService("TweenService")
local tweenStyle = TweenInfo.new(0.25,Enum.EasingStyle.Exponential)
function UpdateSlider()
local output = math.clamp((mouse.X-slider.AbsolutePosition.x)/slider.AbsoluteSize.X,0,1)
local outputClamped = startingValue + (output*(maxValue-startingValue))
if outputValue.Value ~= outputClamped then
tweenService:Create(fill,tweenStyle,{Size = UDim2.fromScale(output,1)}):Play()
end
outputValue.Value = outputClamped
outputLabel.Text = tostring(math.round(outputValue.Value*100))
print(output)
end
fill:GetPropertyChangedSignal("Size"):Connect(function()
outputLabel.Text = tostring(math.round(fill.Size.X.Scale*100))
end)
local sliderActive = false
function ActivateSlider()
sliderActive = true
while sliderActive do
UpdateSlider()
task.wait()
end
end
trigger.MouseButton1Click:Connect(ActivateSlider)
game:GetService("UserInputService").InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
sliderActive = false
end
end)
Change the "MouseButton1Click" to "MouseButton1Down"
@@_icey yeah the one at the end, i also have an other problem, its kinda broken, if i slide it too much to the right, it will be set to 50, or if i set on 50, it will be on 78
@@ch1p_k never had that problem happen to me, not sure what to say about it.
Amazing video, I was wanting a video like this for a while. But I did get a bit confused because of how fast the code was getting added
V A L U E .
We need more GUI tutorials pls❤
One of the best tutorials i have ever seen! Where were you when i was still learning!?
great tutorial, you probably should use runservice instead of while do though
Probably, that would make it frame perfect. If I ever remake this again I will consider this.
Really well made video, nice.
Pro gamer👁️👄👁️
amazing tutorial
Eccellente! 👌👌
within 20 seconds i already had a good idea on what to do
Detailed, Straight to the point. This is a quality tutorial!
This was the hardest tutorial ever, the voice is killing me, and each time he types one word he skips all the way to the end, then half way just changes the code.
This is 1 of the hardest tutorials to follow. I don't know why, maybe it's the text to speech or the fact that it's so fast.
At least you tried, the explanations helped a little. Maybe try slowing the pace down a little, not everyone can type at 300+wpm.
I ended up using AI to finish this as it did not work. I later found out why, some of the code you wrote changed half way through the video.
I can't catch up. It helped, but then it stopped working at the end because i could'nt see line 18.
Great tutorial and easy to follow and modify, thanks! I used it for a vertical throttle slider where the button moves along instead of the bar filling, which wasn't hard to change in this code
The beep in the intro keeps scaring the # out of me every time tho because it sounds like my alarm clock looll
I like that you explained your strategy at the Beginninf
The TTS is giving me calliou parody vibes
You're the first one to be subscribed by me for the first video🎉🎉
I don't know why but slider is going out of the borders lol
got this kinda working but still acting weird
would be awesome to see a slider tutorial for surfaceguis
mine works but u cant drag it :(
W tutorial
Only underrated people make tutorials that are useful every popular developer just reposts stuff
really nice tutorial, one of the bests i've seen.
just one question, how do we make the number scale with the fill with a custom minimum and maximum value?
It's actually shown in the video ( 4:18 )
can i crop code? plss
"Promo SM"
hey im getting an error with the code. if you could help it would be much appreciated. great video still!
I can't help if you don't give me the error message.
@@TaseenA09 it says Trigger is not a valid member of Frame "Players.kingmj4444.PlayerGui.ScreenGui.Main.Main.Slider"
@@TaseenA09 it says Trigger is not a valid member of Frame "Players.kingmj4444.PlayerGui.Screengui.Main.Main.Slider"
@@TaseenA09 it says Trigger is not a valid member of Fram "Player.kingmj4444.PlayerGui.ScreenGui.Main.Main.Slider"
@@TaseenA09 my comments keep getting deleted i literally cant