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

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

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

✓ Accepted answer

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

2 comments

0

u should do it with the player's UserId

0

Thx! This table method will be alot more convient when you add more mods

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