ting = 1 function click() if ting == 1 then Note = game.Workspace:WaitForChild(script.Parent.Parent.Tool.ToolTip) Note.Script.Disabled = true Note.Move.Disabled = true Note.Torso.BodyPosition.position = Vector3.new(0,50,0) Note.Guy.Anchored = false script.Parent.Heal.Disabled = false Note["Body Colors"].HeadColor = BrickColor.Red() ting = 2 if ting == 2 then --for some reason it does this when I click, then doesnt go back to ting = 1 Note = game.Workspace:WaitForChild(script.Parent.Parent.Tool.ToolTip) Note.Script.Disabled = true Note.Move.Disabled = true Note.Torso.BodyPosition.position = Vector3.new(0,5,0) script.Parent.Heal.Disabled = false Note["Body Colors"].HeadColor = BrickColor.Red() ting = 1 end end end script.Parent.MouseButton1Click:connect(click)
You're checking for ting2 immediately after ting1. Ting 1 is being fired, but there's no space inbetween. Basically, if you click, it runs ting 1 then immediately runs ting 2. Here's how I'd write it:
ting = 1 function click() if ting == 1 then Note = game.Workspace:WaitForChild(script.Parent.Parent.Tool.ToolTip) Note.Script.Disabled = true Note.Move.Disabled = true Note.Torso.BodyPosition.position = Vector3.new(0,50,0) Note.Guy.Anchored = false script.Parent.Heal.Disabled = false Note["Body Colors"].HeadColor = BrickColor.Red() ting = 2 elseif ting == 2 then Note = game.Workspace:WaitForChild(script.Parent.Parent.Tool.ToolTip) Note.Script.Disabled = true Note.Move.Disabled = true Note.Torso.BodyPosition.position = Vector3.new(0,5,0) script.Parent.Heal.Disabled = false Note["Body Colors"].HeadColor = BrickColor.Red() ting = 1 end end script.Parent.MouseButton1Click:connect(click)