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

I cant make a admin GUI and i need help from a better scripter. Anybody willing to help?

Asked by 5 years ago

Last time i asked, an admin closed my question. I am making an admin GUI for my game Fishing simulator. But the code i tried to use did not work and the error said "Players.Anotherperson_999.PlayerGui.ExplorerPropertiesGui.Script:2: 'then' expected near 'not'" Code: local admins = {"Anotherperson_999"} if game.Players.LocalPlayer.Name not in admins then script.Parent.Enabled = false end

0
I dont think you can use "in" like that, i may be wrong Fad99 286 — 5y
0
if not admins[name] then ... theking48989987 2147 — 5y
0
Before you try and jump ahead, start learning all of the programming fundamentals, Roblox Wiki has some really good tutorials you can start looking at to begin with on their main page. pidgey 548 — 5y
0
I closed a question of yours earlier today. Might you please review our help articles at https://scriptinghelpers.org/help and review our purposes and what we do at https://scriptinghelpers.org/about . Thank you. M39a9am3R 3210 — 5y
View all comments (4 more)
0
Please use Code Brackets. superawesome113 112 — 5y
0
You should keep the UI in ServerStorage since an exploiter could do script.parent.Enabled = true without problems. JakyeRU 637 — 5y
0
@JaykeRU, it's not necessarily the problem with an exploiter enabling a GUI on the client side, it's a developer's fault if they do not do any verification or authentication of if the person is an admin on the server side. M39a9am3R 3210 — 5y
0
^ RiskoZoSlovenska 378 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

I doubt your code would work with how you have it setup, I haven't seen a "not in" before (doubt it's even a thing)

Try

local player = game.Players.LocalPlayer

local admins = {"User1","User2"}

if not admins[player.Name] then --If player's name not in admins
    script.Parent:Destroy() --Then remove ScreenGUI
else --If player's name is in admins
    wait() --Then do nothing
end

This, on the other hand should work. Put it in a local script right inside the ScreenGUI.

0
Thank you so much. AnotherPerson_999 28 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

I don't entirely know what you're trying to accomplish, but I think I might have a solution. You can try using the script:

game.Players.PlayerAdded:Connect(function(player)
    if player.Name == "UserNameHere" then
        script.Parent.Value = false
    end
end)

This might not be the solution you want, but it is a solution. I'm not sure if "if player.Name == "UserNameHere" or "OtherUserName" then" would work.

-Frumos

Answer this question