You didn't fire the function, a function that placed on the script is not working, else you fire them.
Some function tips:
A function is a thing that defines a specific code that's sandwiched inside the function code.
Function benefit is:
Change the specific code easier if an error occurs.
Make this code at the last of the script:
while wait() do
Value()
end
But that I have a problem that I don't know, does a function with the same name will fire at a same time that the code tell them to fire?
Fixing problems!
Maybe you should replace line 3 to 17 like this,
local function Value()
if Value("5.1312805581556")
then
Value("10")
elseif Value == ("4.1333753849843")
then
Value = ("1")
end
end
Hmmm... Looks something wrong...
Oh! It's the code!
The code line 2, see the problem?
Yeah, it's doesn't have double equals in it.
And the code line 4 was not right, that have no equals so the value might not working!
Replace that code again:
local function Value()
if Value == ("5.1312805581556")
then
Value = ("10")
end
elseif Value == ("4.1333753849843")
then
Value = ("1")
end
end
Something seems not right too...
The full code is like this:
local function Value()
if Value == ("5.1312805581556")
then
Value("10")
elseif Value == ("4.1333753849843")
then
Value = ("1")
end
end
while wait() do
Value()
end
It seems not right too!
If the value was 5.1312805581556, the Value will be 10.
If the value was 4.1333753849843, the Value will be 1.
But what will happen when the Value was not 5.1312805581556 or 4.1333753849843?
The Value might kept the same value!
So we must fix this out,
The full code:
local function Value()
if Value > ("5.1312805581556")
then
Value("10")
elseif Value < ("4.1333753849843")
then
Value = ("1")
end
end
while wait() do
Value()
end
I type so much for helping you out, hope I helped you, if the code was correct, then accept my answer! We'll appreciate much :)
I haven't test this on Roblox studio yet, so if the script was error then tell me! Ask me question if you have anything don't know too!
Bye!
3 comments
What is the script in.is it in the label? If its in the text label it would just be local Value = script.Parent.Text just aksing so i can try to help
If you don't want nasty numbers like that, you can force a whole number using math.floor(), although the number would have to be rounded.
I recommend using whole numbers like he said ^ but to change the text label value just change the textlabel text, i don't understand why you wouldn't do that.