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

What makes this script run when my name isnt in the if statement?

Asked by 6 years ago

I am making a script where if you are a mod, then you will be given a kick gui, but it ends up giving me the gui when my name isn't in the if statement Script:

local notification = script.Parent.Moderator
local Console = script.Parent.Mod
local button = script.Parent.ModButton
local exit = script.Parent.Mod.Exit
game.Players.LocalPlayer.CharacterAdded:Connect(function()
    if game.Players.LocalPlayer.Name == 'toxiccitron123' or 'LexiPadmore' or 'stephencurry90909' then
        notification:TweenPosition(UDim2.new(0.5, -244, 0, 0))
        button:TweenPosition(UDim2.new(1, -105, 1, -55), 'In', 1)
        wait(5)
        notification:TweenPosition(UDim2.new(0.5, -244, -1, 0))
    end
end)
button.MouseButton1Click:Connect(function()
    Console:TweenPosition(UDim2.new(1, -150, 0.5, -119), 'In', 1)
end)
exit.MouseButton1Click:Connect(function()
    Console:TweenPosition(UDim2.new(2, -150, 0.5, -119), 'Out', 1)
end)

LocalScript

1 answer

Log in to vote
2
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
6 years ago

Here's an easier way for checking if the player is a moderator:

local mods = {
      ['toxiccitron123'] = {};
      ['LexiPadmore'] = {};
      ['stephencurry90909'] = {};
}

if mods[game.Players.LocalPlayer.Name] then -- replace like 6 with this
0
u should do it with the player's UserId User#23365 30 — 6y
0
Thx! This table method will be alot more convient when you add more mods Carvizal 25 — 6y
Ad

Answer this question