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

How can a script check if a value is within a certain range of numbers?

How can I check to see if the currentDroplet value is within a certain range of numbers? For ex. 6-11 or 64-78.



for i = 1, 100, 1 do
	--Creates the droplet
	droplet = Instance.new("Part")
	
	--Sets the droplet's properties
	droplet.BrickColor = BrickColor.new("Toothpaste") or BrickColor.new("Teal")
	droplet.Position = Vector3.new(math.random(13,30),math.random(97,108),math.random(33,40))
	droplet.Anchored = true
	droplet.Size = Vector3.new(1, 2, 1)
	droplet.Transparency = 0.8
	currentDroplet = currentDroplet + 1
	droplet.Name = "Droplet"..currentDroplet
	wait(1)
	droplet.Anchored = false
	
	if currentDroplet <=50 then
		droplet.Parent = script.Parent["Droplets1-50"]
	--right here I want to check if the currentDroplet value is equal to any number inbetween 51 and 100
		
		
	end
	
end

1 comment

0

The end outside of the code block is meant to be inside it, sorry

1 answer

✓ Accepted answer
if currentDroplet > 50 and currentDroplet <= 100 then

Try This

3 comments

0

I got an error: Workspace.RainCloud.RainGenerator:21: Expected identifier when parsing expression, got '<='

0

I edited the answer. Try that and see if it works

0

Thank you

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