Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a kick gui only show for the owner?

When I try to make my Kick GUI visible only for me, it makes it visible for everyone. I don't know what to do, but here's the script I tried.

Script (pastebin) I cannot find out how to do this.

4 comments

0

Use a local script to interact with your GUI

0

Or you can just do game.Players{owner name].PlayerGui[etc.]

0

Why not put the UI into the owner's PlayerGui when they join? if PlayerIsOwn then KickUI.Parent = OwnerPlayerGui?

0

Keep the GUI in ServerStorage, tell the script to give it to you when you join the game. Exploiters can't access ServerStorage, they can only use localscripts so they can't take your GUI out of serverstorage

4 answers

Why are you even using "while true"?

Anyways, there's a few ways of doing this. You could check if the player is you, and then clone the GUI into the PlayerGui which would be safer, or using your method:

--From what I can understand, it's a GUI, so you should use a local script and do:
-- services
local players = game:GetService("Players")

-- variables
local player = players.LocalPlayer

-- regulary checking the username
if(player.Name == "YourUsername") then
	script.Parent.Enabled = true
else
	script.Parent:Destroy() -- safer
	-- keeping it there, allows the client to use
	-- an exploit and use the GUI still
	-- so we destroy it
end

3 comments

0

idk why I used "while true", i thought the script would keep running until it did what I said

0

how can I test this?

0

Press the Play button in Studio...

If none of these helped, you could put the gui in server storage. And then when you load in push F9 for dev console. Go to server side and type in the script...

local Gui = game.ServerStorage.KickGui:Clone() Gui.Parent = game.Players.USERNAME.PlayerGui

if you don't do that I would do what shady said. Oh and the script/DevConsole you do that inside the game not in studio.

1 comment

0

Fill in the "KickGui" with the Gui name and fill in "USERNAME" with ur username.

Oh it's easy! if it works, please accept this answer! Thanks!

  1. Put a script in the ServerScriptService
  2. Put your gui in the ServerScriptService, put your gui in the script though that means the script is the gui's Parent
  3. Start scripting!
local Accessors = {"Yournamehere", "Othernamehereifyouwant"} -- Put more commas and double quotes to add more username

game.Players.PlayerAdded:Connect(function(Player)
	for i, players in pairs(Accessors) do
		if Player.Name == players then
			wait(1) -- Make a wait or else it won't work for some reason
			local clone = script.gui:Clone() -- Change the gui to your gui's name
			clone.Parent = Player:WaitForChild("PlayerGui")
		else
			print("You don't have access to use Kick Gui") -- this print is optional if you don't want to, then just delete else and the print
		end
	end
end)

if it doesn't work try this one

local Accessors = {"Yournamhere", "Othernamehereifyouwant"} -- Put more commas and double quotes to add more username

game.Players.PlayerAdded:Connect(function(Player)
	for i=1, #Accessors do
		if Player.Name == Accessors[i] then
			wait(1)
			local clone = script.gui:Clone()
			clone.Parent = Player:WaitForChild("PlayerGui")
		end
	end
end)

That's all! Sorry for late reply thought, I'll consider you already found the answer. Bye!

This discussion is preserved as it was. New answers, comments, and votes are closed.