Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Simple MouseButton1Click script not working?

Asked by 8 years ago

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)
0
So is it not tweening? docrobloxman52 407 — 8y
0
Yeah, it's not tweening. ISellCows 2 — 8y
0
Okay docrobloxman52 407 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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!

0
Thanks. ISellCows 2 — 8y
Ad

Answer this question