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

Simple MouseButton1Click script not working?

Can someone tell me why this won't work? output show's no errors.

local frame = script.Parent.OptionsF.Options
local button = frame["Arrest Database"]
local player = game.Players.LocalPlayer

button.MouseButton1Click:connect(function()
	if player.userId == 40973680 then
		frame:TweenPosition(UDim2.new(0.5,-150,2,-100))
	end
end)

3 comments

0

So is it not tweening?

0

Yeah, it's not tweening.

0

Okay

1 answer

✓ Accepted answer

So what you saying is when the player clicks it checks for the id of them, and if its 40973680 then you say just go to 0.5,-150,2,-100. That is not all the tweening is. This is how you would do it:

        frame:TweenPosition(UDim2.new(0.5,-150,2,-100), "Out", "Quad", 1)

Quad is how the frame slides, and the 1 is how many seconds it takes so like this:

local frame = script.Parent.OptionsF.Options
local button = frame["Arrest Database"]
local player = game.Players.LocalPlayer

button.MouseButton1Click:connect(function()
    if player.userId == 40973680 then
        frame:TweenPosition(UDim2.new(0.5,-150,2,-100), "Out", "Quad", 1)
    end
end)

For more go to http://wiki.roblox.com/index.php?title=Tweening Hope it helps!

1 comment

0

Thanks.

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