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

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

Asked by
Jxyzxrr 13
6 years ago

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.

0
Use a local script to interact with your GUI ABK2017 406 — 6y
0
Or you can just do game.Players{owner name].PlayerGui[etc.] DeceptiveCaster 3761 — 6y
0
Why not put the UI into the owner's PlayerGui when they join? `if PlayerIsOwn then KickUI.Parent = OwnerPlayerGui`? TheeDeathCaster 2368 — 6y
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 ShadyShock 77 — 6y

4 answers

Log in to vote
0
Answered by
Norbunny 555 Moderation Voter
6 years ago
Edited 6 years ago

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:

01--From what I can understand, it's a GUI, so you should use a local script and do:
02-- services
03local players = game:GetService("Players")
04 
05-- variables
06local player = players.LocalPlayer
07 
08-- regulary checking the username
09if(player.Name == "YourUsername") then
10    script.Parent.Enabled = true
11else
12    script.Parent:Destroy() -- safer
13    -- keeping it there, allows the client to use
14    -- an exploit and use the GUI still
15    -- so we destroy it
16end
0
idk why I used "while true", i thought the script would keep running until it did what I said Jxyzxrr 13 — 6y
0
how can I test this? Jxyzxrr 13 — 6y
0
Press the Play button in Studio... DeceptiveCaster 3761 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

!enter image description here

https://ghostbin.com/paste/msksf

0
This is the best answer so far, and also I don't know how to do that code thing properly so I just uploaded in image, and there's the link to the script. ShadyShock 77 — 6y
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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...

1local 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.

0
Fill in the "KickGui" with the Gui name and fill in "USERNAME" with ur username. XX_Doggoa 24 — 6y
Log in to vote
0
Answered by 4 years ago

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!
01local Accessors = {"Yournamehere", "Othernamehereifyouwant"} -- Put more commas and double quotes to add more username
02 
03game.Players.PlayerAdded:Connect(function(Player)
04    for i, players in pairs(Accessors) do
05        if Player.Name == players then
06            wait(1) -- Make a wait or else it won't work for some reason
07            local clone = script.gui:Clone() -- Change the gui to your gui's name
08            clone.Parent = Player:WaitForChild("PlayerGui")
09        else
10            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
11        end
12    end
13end)

if it doesn't work try this one

01local Accessors = {"Yournamhere", "Othernamehereifyouwant"} -- Put more commas and double quotes to add more username
02 
03game.Players.PlayerAdded:Connect(function(Player)
04    for i=1, #Accessors do
05        if Player.Name == Accessors[i] then
06            wait(1)
07            local clone = script.gui:Clone()
08            clone.Parent = Player:WaitForChild("PlayerGui")
09        end
10    end
11end)

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

Answer this question