If statement not registering correctly

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Animate = Character:WaitForChild("Animate")
local mouse = Player:GetMouse()


local loadanim = Character:WaitForChild("Humanoid").Animator:LoadAnimation(anim)
loadanim:AdjustWeight(math.huge)
local debounce = false

clicks = 0
UIS.InputBegan:Connect(function(input)
	if input == Enum.UserInputType.MouseButton1 then
		print("hmm")
	if script:FindFirstAncestorWhichIsA("Model") then
			print("running")
			clicks = clicks + 1
			if clicks < 1 then print(clicks) return end
			clicks = 0
			wait()
			if debounce == false then
			
			debounce = true
			local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
				controls:Disable()
				Character.HumanoidRootPart.Anchored = true
				script.Parent.Handle.Trail.Enabled = true
				Character:SetPrimaryPartCFrame(CFrame.new(Character.HumanoidRootPart.Position ,Vector3.new(mouse.Hit.Position.X , Character.HumanoidRootPart.Position.Y - 2 , mouse.Hit.Position.Z) ))
			Character:WaitForChild("Humanoid"):MoveTo(Character.HumanoidRootPart.Position )
				loadanim:Play()

				loadanim.Stopped:Wait()
				script.Parent.Handle.Trail.Enabled = false
				controls:Enable()
				script.Parent.Parent.CanMove.Value = false
				Character.HumanoidRootPart.Anchored = false
		end
			debounce = false
			script.Parent.Parent.CanMove.Value = false
	end
	end
end)


When i press the mousebutton1 with the tool equipped nothing prints

if input.UserInputType == Enum.UserInputType.MouseButton1 then --you forgot .UserInputType
1 Like

oops :shallow_pan_of_food: :shallow_pan_of_food: