Right now i'm on a mac and my game has two separate parts but i always freeze when it shows up my script first makes it when the touch a button a gui shows up
local Gui = game.Lighting.ScreenGui
function GiveGui(Player)
if Player.PlayerGui:FindFirstChild(Gui.Name)~=nil then return end
Gui:Clone().Parent = Player.PlayerGui
end
script.Parent.Touched:connect(function(hit)
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player == nil then return end
GiveGui(Player)
end)
Then i have the teleporting script
button = script.Parent
tele = game:GetService('TeleportService')
button.MouseButton1Down:connect(function()
local player = game.Players.LocalPlayer
tele:Teleport(443798340, player)
end)
but is there anyway to stop this from freezing me on mac

5 comments
I suggest that you move your gui from lighting to serverstorage, it's must more effective than lighting.
ik but when i tried that it didnt move for whatever reason but is there any actual way to solve this problem
actually > move it to replicated storage i suggest.
I don't think there's a way around this "freezing".
I really don't think that you using a Mac affects anything. I have a Macbook.