Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How many assets can you have and can you make an exit game button?

Asked by 8 years ago

Question #1, How many assets could a game have and does it matter? If you're using streaming (have StreamingEnabled enabled) than is there a limit? My game uses nothing but screen guis and a ton of assets(Images). Would the player begin to experience lag if I add too many?

Question #2, Is is possible to have the player press a button and then the game would automatically close? I'm wondering because... Well because that would be cool to have :P

 Thanks for reading (: 
1
I'm not sure about Question #1, but for Question #2, RoBLOX doesn't allow that Shawnyg 4330 — 8y

1 answer

Log in to vote
1
Answered by
Wutras 294 Moderation Voter
8 years ago

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) -- Creates a TextButton
textbutton.Text = "Leave Game" -- Changes the TextButton's text
textbutton.MouseButton1Down:connect(function() -- An event of the TextButton
    if textbutton.Parent.Parent:IsA("Player") then -- Checking if the Second Parent is a  Player
        textbutton.Parent.Parent:Kick("You've left the game.") -- Using the :Kick("string") method on the Player.
    end
end

Hope this helps with the understanding! If you got any questions, feel free to ask!

0
Yeah, that helped a lot. Thanks m8! User#11440 120 — 8y
0
No problem. :) Wutras 294 — 8y
Ad

Answer this question