Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

1 comment

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!

Majbe try

value.Changed:Connect(function(x))
if x >= 0 and x <= 8 then
[TEXT VARIABLE].Text = "test2"
end
end)

1 comment

0

I got this: attempt to index field 'ClockTime' (a number value)

This discussion is preserved as it was. New answers, comments, and votes are closed.