If Not statement not working at all

Issue I am having is when my attribute do signal changes it prints(“World”) which works fine but my if not statement isn’t working for example if the attribute is set to ‘Dollars’ I am not getting the warn(“Nothing”) message. I also tried seeing if it would warn if it is set to ‘Total’ but still nothing.
Script is in ServerScriptService.
I am trying to check if do attribute does not == Total

game.Players.PlayerAdded:Connect(function(plr)
	task.wait(4)
	plr.Money.Values:GetAttributeChangedSignal("do"):Connect(function(playerd)
		print("Worlds")
		if plr.Money.Values:GetAttribute("do") == not "Total" then
			warn("Nothing")
			end
	end)

end)
3 Likes

not "Total" is valid syntax, but it’s incorrect in terms of what you want to do.

game.Players.PlayerAdded:Connect(function(plr)
	task.wait(4)
	plr.Money.Values:GetAttributeChangedSignal("do"):Connect(function(playerd)
		print("Worlds")
		if plr.Money.Values:GetAttribute("do") ~= "Total" then -- '~=' means not equal to
			warn("Nothing")
			end
	end)

end)
4 Likes

Thanks for your help!!

This text will be blurred for no reason :slight_smile:

1 Like

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