So I’m basically trying to create a slider bar for my game. I haven’t found a good example that I could learn from. I was trying to use GetMouseLocation to get the location, but this only prints in pixels. How would I make this work for scaling, and how would I get what I want after this?
I know I don’t have a lot to go off of right now, I’m very new to UserInputService and everything related
Here's the script
local frame = script.Parent
local player = game.Players.LocalPlayer
if player.Name == "Derpee_Kirbee" then
frame.Visible = true
else
frame.Visible=false
end
local UIS = game:GetService("UserInputService")
local sliderButton = script.Parent.SliderImage
sliderButton.MouseButton1Down:Connect(function()
print("Mouse Clicked over Button")
print(game.Workspace.CurrentCamera.ViewportSize)
end)
UIS.InputEnded:Connect(function(input,processed)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
print("Input ended")
print(UIS:GetMouseLocation())
end
end)