Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local players=game:GetService'Players'
- asshat={}
- --GetHumanoidFromAsshat
- --GetPlayerFromAsshat
- --GetBottomCharacter
- --[[
- if the player isn't sitting then they own all the connect parts
- --]]
- function asshat.create()
- local hat=Instance.new'Hat'
- hat.Name='Asshat'
- hat.AttachmentPos=Vector3.new(0, 0.4, 0)
- local seat=Instance.new'Seat'
- seat.Parent=hat
- seat.Name='Handle'
- seat.Size=Vector3.new(2, 1, 1)
- seat.Transparency=1
- local bf=Instance.new('BodyForce', seat)
- bf.force=Vector3.new(0, seat:GetMass()*200, 0)
- return hat
- end
- function asshat.register(player, _)
- player = type(player)=='number' and _ or player
- player.CharacterAdded:connect(function(char)
- repeat wait() until char.Parent==workspace
- wait(1)
- local hat=asshat.create()
- hat.Parent=char
- print(hat)
- hat.Handle:SetNetworkOwner(player)
- local humanoid=char:WaitForChild'Humanoid'
- humanoid.Changed:connect(function(prop)
- if prop=='Sit' and humanoid.Sit==false then
- for _, part in pairs(char:WaitForChild'Torso':GetConnectedParts(true)) do
- print(part:GetFullName(), player)
- part:SetNetworkOwner(player)
- end
- end
- end)
- local seat=hat.Handle
- seat.Changed:connect(function(prop)
- if prop=='Occupant' then
- if seat.Occupant then
- for _, part in pairs(char:WaitForChild'Torso':GetConnectedParts(true)) do
- print(part:GetFullName(),char.Torso:GetNetworkOwner())
- part:SetNetworkOwner(char.Torso:GetNetworkOwner())
- end
- end
- end
- end)
- end)
- end
- table.foreachi(players:GetPlayers(), asshat.register)
- players.PlayerAdded:connect(asshat.register)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement