So, I have a utg for a game im making and I have a whitelist so that if someone were to try to use it without being whitelisted they get kicked, and last night when I tested it it worked, but now I added to the script to play a sound if they are whitelisted and now it doesn't work. I checked to make sure the names are correct and no typos and idk why it isnt working now.
script.Parent.Frame.Visible = false
local player = game.Players.LocalPlayer
local AllowedPlayers = {'pokemon9master29','coolman2555555'}
for i = 1, #AllowedPlayers do
if player.Name == AllowedPlayers[i] then
script.Parent.Parent.SPTW1.Playing = true
script.Parent.Frame.Visible = true
script.NotWhitelsited.Playing = false
script.Parent.NotWhitelisted.Visible = false
else script.Parent.NotWhitelisted.Visible = true
script.NotWhitelsited.Playing = true
wait(0.1)
player:Kick('You are not whitelisted and/or permitted to use JoJUTG')
end
end
I have checked over everything and can't find the problem.

1 comment
I'd actually like to add that you could use a remote event here, since you're not doing much on the client, but either works fine.