I have a server script inside that detects if a player goes into the elevator:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then
print('touched by '.. hit.Parent.Name)
local partyowner = game.Players[script.Parent:GetAttribute('Owner')]
if not partyowner.PartyList:FindFirstChild(hit.Parent.Name) then
print('2')
local partyplayer = Instance.new('StringValue', partyowner.PartyList)
partyplayer.Name = hit.Parent.Name
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.Character.HumanoidRootPart.Position = script.Parent.Position
player.Character.Humanoid.WalkSpeed = 0
player.PlayerGui.LeaveGui.Leave.Visible = true
player.InPlayersParty.Value = script.Parent:GetAttribute('Owner')
end
end
end)
When they leave the party it doesnt allow them to join back.
Leave Local Script:
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local partyowner = game.Players[player.InPlayersParty.Value]
partyowner.PartyList[player.Name]:Destroy()
player.InPlayersParty.Value = ''
script.Parent.Visible = false
player.Character.HumanoidRootPart.CFrame = workspace.LeaveTeleport.CFrame
player.Character.Humanoid.WalkSpeed = 16
end)
Video: https://streamable.com/xdlk8b
It also prints print('touched by '.. hit.Parent.Name)
this piece of code the other times they try to join.