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

why does this script not check the value correctly?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
if mouse.Target.BrickColor == BrickColor.new("New Yeller") and player.leaderstats.level.Value >= 1 then
                    thing()
                elseif mouse.Target.BrickColor == BrickColor.new("Deep orange") and player.leaderstats.level.Value >= 5 then
                    thing()
elseif player.leaderstats.level.Value > 5 and mouse.Target.BrickColor == BrickColor.new("Deep orange") then
    print'no level for you' -- this never happens
                elseif mouse.Target.BrickColor == BrickColor.new("Lime green") and player.leaderstats.level.Value >= 10 then
                    thing()
end

where mouse = game.Players.LocalPlayer:GetMouse() and thing() is a function I KNOW that its something with the if's or the values being dumb, because i set my level val to 1, and it still didn't print anything when i moved my mouse over it.

basically, this is supposed to make it so that if the mouses target is say, green, and the player's leaderstat value 'level' is not greater than, or equal to ten, but for some reason, it's not printing anything when the mouses target is deep orange.

the level requirments are because

the color is an identifier, both with sight and script.

0
A good title describes YOUR question, not every one on this site. BlueTaslem 18071 — 8y
0
Can you briefly explaining the reasoning behind the difference choices? Why the mix of color and level requirements? BlueTaslem 18071 — 8y
0
done ScriptsAhoy 202 — 8y

Answer this question