local menu = game.Players.LocalPlayer.PlayerGui.Gui.Menu
local userInputService = game:GetService("UserInputService")
local menuOut = false
local cooldown = false
userInputService.InputBegan:Connect(function(input, isTyping)
if isTyping then return
else if cooldown == false and menuOut == false and input.KeyCode == Enum.KeyCode.M then
game.ReplicatedStorage.RemoteEvent.MenuOut:FireClient()
menuOut = true
cooldown = true
wait(1)
cooldown = false
else if cooldown == false and menuOut == true and input.KeyCode == Enum.KeyCode.M then
game.ReplicatedStorage.RemoteEvent.MenuIn:FireClient()
menuOut = false
cooldown = true
wait(1)
cooldown = false
end
end
end
end)
The above script was meant to fire a remote event to a local script
local menu = script.Parent
game.ReplicatedStorage.RemoteEvent.MenuIn.OnClientEvent:Connect(function()
menu:TweenPosition(UDim2.new(1,0, -0.05,0),"Out","Quad",0.5,false)
end)
game.ReplicatedStorage.RemoteEvent.MenuOut.OnClientEvent:Connect(function()
menu:TweenPosition(UDim2.new(0.8,0, -0.05,0),"Out","Quad",0.5,false)
end)
When M was pressed, then the "menu" would move in/out
But it doesn't seems to work, can anyone help?
