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

I am stuck trying to remove all players gui in players how would i locate it?

Asked by 5 years ago
Edited 5 years ago
local Players = game:GetService("Players")


function onPlayerAdded(player) --Finds when players join
    local playergui = player.PlayerGui --Goes Into Players Gui's

wait(1)--Waited Time


RPG_KIT_-PLEASE_KEEP_ME_:):destroy() --I am stuck trying to remove a players gui how would i locate it?
0
When I try to run the code, it errors. Try changing the name from "RPG_KIT_-PLEASE_KEEP_ME_:)" to something without special characters. Kev_nn 4 — 5y

1 answer

Log in to vote
0
Answered by
yHasteeD 1819 Moderation Voter
5 years ago
Edited 5 years ago

Use :FindFirstChild(): FindFirstChild - WIki

And insert a localscript in StarterGui and put this code:

local gui_for_destroy_name = "RPG_KIT_-PLEASE_KEEP_ME_:)" -- GUI Name

wait(0.3)

if script.Parent:FindFirstChild(tostring(gui_for_destroy_name)) then -- if find gui
    script.Parent[tostring(gui_for_destroy_name)]:Destroy() -- destroy gui
end

-- Remember. game.Players.PlayerAdded not works in LocalScript.

Hope it helped :D

Ad

Answer this question