Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to have an event occur when a value is in between two others?

Asked by 5 years ago

I'm back again with the same script but now I'm trying to figure out how to have the text change when it's in between two values.

if l.ClockTime >= 0 and <=8 then
    [TEXT VARIABLE].Text = "Test2"
end

Obviously that isn't the correct way of doing it, so how do I fix it?

2 answers

Log in to vote
1
Answered by 5 years ago

Hello once again.. This works. You just need to loop it..

local cc = script.Parent


local l = game.Lighting

while true do
    if l.ClockTime >= 0 and l.ClockTime <= 8 then

        script.Parent.Text = "Yo What's Good"
    else
        script.Parent.Text = "RUN!"
    end
    wait()
end
0
Yeah thats what I was also inquiring, how to make it "check" for when it passed a certain time, over it just going through once. Thanks! MustangHeart 67 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Majbe try

value.Changed:Connect(function(x))
if x >= 0 and x <= 8 then
[TEXT VARIABLE].Text = "test2"
end
end)
0
I got this: attempt to index field 'ClockTime' (a number value) MustangHeart 67 — 5y

Answer this question