Hello I want to make a button that moves my GUI back to the ReplicatedStorage. (With the open script I move it to PlayerGUI)
Heres a Image of my Screen: https://www.imageupload.net/image/robloxstudioscreenshot.HUa9g
ScreenShower Script:
local ScreenGui = game.ReplicatedStorage.GUI.Cafe
script.Parent.MouseClick:Connect(function(mouse)
local clone = ScreenGui:Clone()
clone.Parent = mouse.PlayerGui
end
end)
Animation LocalScript:
local Mouse = game.Players.LocalPlayer:GetMouse()
local button = script.Parent
local SK = false
local Plus = script.Parent.Follow
local Zone = script.Parent.Click
local SpeedS = 1
local TweenService = game:GetService("TweenService")
local tweenClick = TweenInfo.new(SpeedS,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0)
button.MouseButton1Click:connect(function()
local G = Zone:Clone()
G.Position = UDim2.new(0,Mouse.X-button.AbsolutePosition.X,0,Mouse.Y-button.AbsolutePosition.Y)
G.Parent = button
local tween = TweenService:Create(G, tweenClick, {Size = UDim2.new(1,0,1,0),ImageTransparency = 1})
tween:Play()
wait(SpeedS)
G:Destroy()
end)
button.MouseEnter:Connect(function()
SK = false
Plus.Visible = false
repeat wait()
Plus.Position = UDim2.new(0,Mouse.X-button.AbsolutePosition.X,0,Mouse.Y-button.AbsolutePosition.Y)
until SK == true do
end
end)
button.MouseLeave:Connect(function()
SK = true
Plus.Visible = false
end)
Thanks for your great help ^^

1 comment
you want it to move when u press lets say K to replicated storage and if u press leys say L it will move back or smt ?