i want to make a script that detects certain players that join the game, and if it finds that player then they are allowed to use an ability but it wont work at all
local players = game.Players
local uis = game:GetService("UserInputService")
local allowed = false
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if player.Name ~= "bonniebunnyomg" then
allowed = false
print("not allowed")
else
allowed = true
print("allowed")
end
end)
end)
uis.InputBegan:Connect(function(input, gpe)
if gpe then return end
if allowed == true and input.KeyCode == Enum.KeyCode.E then
print("e pressed")
end
end)
any help?
** You are now Level 9! **