MouseButton1 Working In Studio, But Not In Game

I’ve created a working combat system in studio and wanted to try it out in the actual roblox launcher and it didn’t work. Pressing mousebutton1 doesn’t work, ive moved the script from playerscripts into characterscripts and theres no solution. This is what it looks like in studio:

In game it of course, doesn’t work. Also, right after recording the footage above M1s stopped working in studio forcing me to close and reopen the studio test.

This is the local script for M1s:

print("Loaded")

Mouse.Button1Down:Connect(function()
	print("M1")

	if UserInputService:IsKeyDown(Enum.KeyCode.Space) then 
		M1Pressed:FireServer("Uptilt")
		return
	end

	if Humanoid:GetState() == Enum.HumanoidStateType.Freefall or Humanoid:GetState() == Enum.HumanoidStateType.Jumping then 
		M1Pressed:FireServer("Downslam")
		return
	end

	M1Pressed:FireServer("Normal")
	return
end)

Edit: In another game I made, i used mousebutton1down in startercharacterscripts and it worked with no issues in game or in studio, but that doesn’t work here for some reason.

What device are you testing on? I’m not sure if MouseButton is supported on all devices, roblox favour’s the Activated event instead.

Both tests are done on the same exact pc, ill give activated a try.

Found a solution. I’ve switched to UserInputService, moved the script into startercharacter, and changed the character variable to script.Parent and removed the player variable. I’m guessing it wasn’t loading for whatever reason.

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