Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

MouseButton1Up is not a valid member of TextButton?

Hello, I am trying to create a repeating tweened GUI that stops once you click a GUI text button. But, whenever I try out the script, the tween does not play and stops the rest of the script.

This is the Local Script

Aimbar.ClickFrame.MouseButton1Up = true

repeat
	player.PlayerGui.Screen.AimBar.AimStick:TweenPosition(
		UDim2.new(0.951, 0, -0.5, 0),
		"InOut",
		"Sine",
		1, 
		false, 
		nil
	)
	wait(1.01)
	player.PlayerGui.ScreenGUI.AimBar.AimStick:TweenPosition(
		UDim2.new(0.026, 0, -0.5, 0),
		"InOut",
		"Sine",
		1,
		false, 
		nil
	)
	wait(1.01)
until Aimbar.ClickFrame.MouseButton1Up == true

2 answers

✓ Accepted answer

I see what's wrong. It's the very first line. You can't just set MouseButton1Up to true because it's not a value that you can change. It's more of a trigger. It would be like the computer holding down left click for you. Since the code will stop once it senses an error, simply remove the first line and that should work

This discussion is preserved as it was. New answers, comments, and votes are closed.