✓ Accepted answer
Answer to question 1:
Those assets are all being loaded in the beginning of the game, so they will only then cause "lag". That "lag" is not even lag, it's just taking the game longer to load the textures and this may seem like lag. You may fix that by creating a loading GUI for the game that's being opened in the beginning and closed when the assets were loaded. If you add a lot of assets while the game is in progress then this won't cause lag, but those textures will be nothing, but grey until they've loaded.
Also, I don't know it for sure, but I think StreamingEnabled is limiting the amount of assets.
Answer to question 2:
Yes, there is a way to leave the game using a TextButon, ImageButton or even ClickDetector. CLOSING the program itself is NOT possible. If you want to develop such a "Leave Game"-button then you should definitely use the method :Kick("string"). It can only be used on Player objects and the argument you CAN pass in has to be a string. This string will be the message the player receives in that red box in the upper region of the game interface. The method :Kick("string") will simply disconnect the client(Player) from the server(Game).
This here would be a possible using of the method:
textbutton = Instance.new("TextButton", game.StarterGui)
textbutton.Text = "Leave Game"
textbutton.MouseButton1Down:connect(function()
if textbutton.Parent.Parent:IsA("Player") then
textbutton.Parent.Parent:Kick("You've left the game.")
end
end
Hope this helps with the understanding! If you got any questions, feel free to ask!
1 comment
I'm not sure about Question #1, but for Question #2, RoBLOX doesn't allow that