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

How can I refresh the whole player and not just the character?

Asked by
Rukreep 15
3 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

Is there a way of refreshing the entire player so that all of their GUIs are deleted except for the default ones?

2 answers

Log in to vote
0
Answered by
MattVSNNL 620 Moderation Voter
3 years ago

Maybe this will work

local Players = game:GetService("Players")

for i, gui in pairs(Players:GetDescendants()) do
    if gui:IsA("ScreenGui") and not gui.Name == "Chat" and not gui.Name == "FreeCam" and not gui.Name == "BubbleChat" then
        gui:Destroy()
    end
end
0
Nope, doesn't work. Rukreep 15 — 3y
0
: ( MattVSNNL 620 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

Set you GUIs so they Don't rest on spawn, Apart form the ones you want left on.

You could do something like


game.StarerGui.YOURGUI.Restonspawn = false

Then you could kill the player to rest or try the load character thing

player:LoadCharacter()

More on that here https://developer.roblox.com/en-us/api-reference/function/Player/LoadCharacter

0
Rest on spawn? I've never heard of that... Rukreep 15 — 3y

Answer this question