local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Number = game.StarterGui.ScreenGui.RadioNumb.Radio.Value
local textGui = script.Parent
local uis = game:GetService("UserInputService")
uis.InputEnded:Connect(function(inst)
if inst.KeyCode == Enum.KeyCode.E then
if Number ~= 101.1 then
Number = Number + 0.1
textGui.Text = tostring(Number)
print("work")
elseif inst.KeyCode == Enum.KeyCode.Q then
if Number ~= 99.9 then
Number = Number - 0.1
textGui.Text = tostring(Number)
print("work")
end
end
end)
I've updated the script for the radio, now it stopped working. Help?
1 answer
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Number = script.Parent.Radio.Value
local textGui = script.Parent
local uis = game:GetService("UserInputService")
uis.InputEnded:Connect(function(inst)
if inst.KeyCode == Enum.KeyCode.E and Number < 101.1 then
Number = Number + 0.1
textGui.Text = tostring(Number)
print("work")
elseif inst.KeyCode == Enum.KeyCode.Q and Number > 99.9 + 0.1 then -- without +0.1 it would be able to have a 99.8 value, don't think you want that
Number = Number - 0.1
textGui.Text = tostring(Number)
print("work")
end
end)
10 comments
Thank you again! You're being really helpful with this :D
You're welcome! :)
Now it starts to go over the top number, what happened?
I see why. You're picking up the value from the startergui, not from the playersgui, that way it wont update for the player. Could you tell me where you script is located so I could help you?
StarterGui -> ScreenGui -> TextGui:RadioNumb -> IntValue:Radio, LocalScript:changeStation
Updated my awnser, now it fully works (also tested it ingame)!
fixed it, forgot to make as code block
Thank you for all your help! You're the only reason i can make this "game" (it's more of a vibe game thing)
you're welcome! :D Good luck with your "game" xD
btw I got the name wrong, its "Radio", not "RadioNumb". My bad
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I tried to make it limited to a certain amount of numbers, but then it stopped working.