if mouse.Target.BrickColor == BrickColor.new("New Yeller") and player.leaderstats.level.Value >= 1 then _G.q = false thing() elseif mouse.Target.BrickColor == BrickColor.new("Deep orange") and player.leaderstats.level.Value > 5 then _G.q = true elseif mouse.Target.BrickColor == BrickColor.new("Deep orange") and player.leaderstats.level.Value >= 5 then _G.q = false thing() elseif mouse.Target.BrickColor == BrickColor.new("Lime green") and player.leaderstats.level.Value > 10 then _G.q = true elseif mouse.Target.BrickColor == BrickColor.new("Lime green") and player.leaderstats.level.Value >= 10 then _G.q = false thing() end
where mouse = game.Players.LocalPlayer:GetMouse() and thing() is a function that works i did a print(_G.q), and it printed false. always printed false, no matter what, what it's supposed to do is if the mouses targets brickcolor is orange, and my level is less then 5, it's supposed to make _G.q true, but it doesn't. any help?
Your problem is in the way the script is ordered. I see that the only reason "true" would return is if the third argument was true, but the problem is that if the value is bigger than 10 then it is definitely bigger than 5 meaning your first argument will return false right away instead of moving on to any other arguments. Try ordering your script like this:
if mouse.Target.BrickColor == BrickColor.new("New Yeller") and player.leaderstats.level.Value >= 1 then _G.q = false elseif mouse.Target.BrickColor == BrickColor.new("Deep orange") and player.leaderstats.level.Value > 10 then _G.q = true thing() elseif mouse.Target.BrickColor == BrickColor.new("Deep orange") and player.leaderstats.level.Value > 5 then _G.q = true elseif mouse.Target.BrickColor == BrickColor.new("Deep orange") and player.leaderstats.level.Value >= 5 then _G.q = false thing() elseif mouse.Target.BrickColor == BrickColor.new("Lime green") and player.leaderstats.level.Value >= 10 then _G.q = false thing() end
Now the script will always check if the value is greater than 10, before moving on to seeing if its bigger than 5. Hope this helped, feel free to ask any questions.