The script is supposed to allow a shop GUI to be opened and closed when in a certain range of a part. I don't get any errors in output when testing the script either.
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Mag = (game.Workspace.Part.Position - player.Character:WaitForChild("HumanoidRootPart").Position).magnitude
mouse.KeyDown:Connect(function(key)
if key == "e" then
if Mag <= script.Parent.Range.Value then
game.StarterGui.Gui.MainFrame.Visible = not game.StarterGui.Gui.MainFrame.Visible
end
end
end)
