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

is there any way i can make a peice of code that looks through a certain "Array" of numbers?

im trying to check a rank thats "Through a number" like 11-15 so 11,12,13,14,15, How would i type that in code?? so far i have

game.Players.PlayerAdded:Connect(function(plr)
	if plr:GetRankInGroup(8696053) == 11-15then
		plr.Team = team.leaders
	end        
end)

Why is this not working?

Thank you for helping me with this peice of code.

Let me know if i can help with anything else?

1 answer

✓ Accepted answer

You could do either of below.

--making a function
function between(num, low, high)
	if num <= high and num >= low then
		return true
	else
		return false
	end
end

game.Players.PlayerAdded:Connect(function(plr)
    if between(plr:GetRankInGroup(8696053), 11, 15) then
        plr.Team = team.leaders
    end        
end)

-- or just doing this simple check
game.Players.PlayerAdded:Connect(function(plr)
    if plr:GetRankInGroup(8696053) >= 11 and plr:GetRankInGroup(8696053) <= 15 then
        plr.Team = team.leaders
    end        
end)

2 comments

0

That doesent work with this.

0

Nvm tried it again, thank you so much

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