Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local PlayerValue = ReplicatedStorage:WaitForChild("Player")
- Players.PlayerAdded:Connect(function(plr)
- if PlayerValue.Value == nil then
- PlayerValue.Value = plr
- print("New User whitelisted")
- else
- plr:Kick("Only one player is allowed")
- end
- end)
- Players.PlayerRemoving:Connect(function(plr)
- if PlayerValue.Value == plr then
- PlayerValue.Value = nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment