So I'm trying to make a UI for someone, but I've encountered a problem, when I activate the UI which uses the key M it works perfectly but when someone else tries it, it doesn't work. I've tried cloning the UI to playerGui but it only worked for me and no one else, I have tried looking at so many articles but to no avail. I was hoping someone could help me here.
Here is some of my code.
--Local Script Inside of StarterGui
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GUI = ReplicatedStorage.MainMenu
local player = game.Players.LocalPlayer
player.CharacterAdded:Connect(function()
GUI:Clone().Parent = player.PlayerGui
end)
--Script to open the menu that is in Replicated Storage along with the UI
local frame = script.Parent.Parent.Frame
local uis = game:GetService("UserInputService")
uis.InputBegan:connect(function(inst)
if inst.KeyCode == Enum.KeyCode.M then
frame.Visible = true
end
end)
I just can't seem to find a fix for this, I would appreciate any feedback or help!

2 comments
I mean why would you put it in ReplicatedStorage when everyone will have it straight away? Put in PlayerGui.
Because nothing else worked for me before, so I decided to clone it, no one I mean literally no one has the GUI except me, for some reason it only clones it for me.