Weird issue with If Statement

Now, normally I wouldn’t ask for help with something as trivial as an if statement. But for some reason, this one isn’t working and I do not know why.

What’s supposed to happen, is it sets easts value to true (which it does) and check constantly so it can give the multiplier for the zone. Now, its only supposed to multiply it once. Instead, it keeps multipling it by mult’s value even though east is true.

There is no errors, this could be a roblox bug.

ztor = script.Parent
while wait(1) do
	for i, v in pairs(game.Players:GetPlayers()) do
		tor = v.Character.HumanoidRootPart
		if (tor.Position-ztor.Position).Magnitude < 17.5 then
			if tor.Parent.Head.tim.east.Value == false then
				tor.Parent.Head.tim.east.Value = true
				tor.Parent.Head.tim.Value *= script.Parent.mult.Value
			    print("mtly")
			end
		else
			if tor.Parent.Head.tim.east.Value == true then
				print("unmuly")
				tor.Parent.Head.tim.east.Value = false
				tor.Parent.Head.tim.Value /= script.Parent.mult.Value
			end
		end
	end
end

Something like this has happened to me before when I was trying to clone a part into the workspace using an if statement it cloned twice when it was meant to clone once. I just assumed it was a Roblox bug.

1 Like

I found a workaround, weird that this didnt work though.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.