I'm currently trying to figure out how to properly use greater than and less than scripts but am pretty much stuck at trying to figure out how to make this work properly, whenever I set the Currentstate value to anything lower than 8 nothing happens, neither with lower than 2. The CurrentState value is 10
local state = script.Parent.Head.States local currentstate = script.Parent.CurrentState.Value local face = script.Parent.Head.face if currentstate >= 8 then face.Texture = state.HappyState.Texture end if currentstate <= 8 then face.Texture = state.NeutralState.Texture end if currentstate <= 2 then face.Texture = state.SadState.Texture end
I see a few problems with your script.
When you have the >= 8
and the <= 8
, they will both fire when currentstate == 8
, so i suggest picking one to have fire when it's 8.
Also, I suggest removing the .Value
in line 2 (as someone else had pointed out). When you have that, once the game is ran the currentstate is automatically put to the default value, so nothing will work.
Hopefully this works, and if you have any questions, please feel free to ask them! :D