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

Problem with my MouseButton1Down code?

I get a error when trying to use this code I made, and i'm not sure why. Help?

Error: Players.Player.PlayerGui.ScreenGui.TextButton.LocalScript:4: unexpected symbol near ','

script.Parent.MouseButton1Down:connect(function(clicker)
	repeat
		clicker.Character.Head.Mesh.Scale = clicker.Character.Head.Mesh.Scale + 0.25, 0.25, 0.25
	until clicker.Character.Head.Mesh.Scale == 4, 4, 4
end)

1 comment

0

use vector3.new for the 0,0,0

2 answers

script.Parent.MouseButton1Down:connect(function(clicker)
    repeat
        clicker.Character.Head.Mesh.Scale = clicker.Character.Head.Mesh.Scale + Vector3.new(0.25, 0.25, 0.25)
    until clicker.Character.Head.Mesh.Scale == Vector3.new(4, 4, 4)
end)

This should work.

2 comments

0

Players.Player.PlayerGui.ScreenGui.TextButton.LocalScript:3: attempt to index local 'clicker' (a number value)

0

Please explain your answers. And this would not work.

This might work.

function clicker()
    repeat
        clicker.Character.Head.Mesh.Scale = clicker.Character.Head.Mesh.Scale + Vector3.new(0.25,0.25,0.25)
    until clicker.Character.Head.Mesh.Scale==Vector3.new(4,4,4)
end

script.Parent.MouseButton1Down:connect(clicker)

Hope this helped!

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