Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until #game:GetService("Players"):GetPlayers() > 0
- local coms = {Instance.new("RemoteEvent",script),Instance.new("RemoteFunction",script),Instance.new("RemoteFunction",script)}
- local owner = owner or game:GetService("Players"):WaitForChild("plytalent")
- local FF = Instance.new("ForceField",owner.Character)
- local waitremote = Instance.new('RemoteEvent',script)
- local conchar = nil
- FF.Visible = false
- local comsfuncs={
- function(plr, partname, partposition, partsize, partorientation)
- if plr ~= owner then
- return
- end
- if owner.Character.Parent then
- owner.Character.Parent = nil
- end
- if not conchar then
- conchar = Instance.new("Model",workspace)
- hum = Instance.new("Humanoid",conchar)
- hum.MaxHealth = 1
- return
- end
- if not conchar.Parent then
- conchar=nil
- return
- end
- if FF.Parent ~= owner.Character then
- FF = Instance.new("ForceField",owner.Character)
- FF.Visible = false
- end
- conchar.Name = "Ghost"
- local part = conchar:FindFirstChild(partname)
- if not part then
- pcall(function()
- part = Instance.new("Part",conchar)
- part.Size = partsize
- part.Name = partname
- part.Position = partposition
- if partname == "Head" then
- local headmesh = Instance.new("SpecialMesh",part)
- headmesh.Scale = Vector3.new(1.25,1.25,1.25)
- headmesh.MeshType = Enum.MeshType.Head
- end
- end)
- end
- if part then
- if not part:FindFirstChild("PartAlignPos") then
- part.Position = partposition
- local AlignPosition = Instance.new("AlignPosition",part)
- local AlignOrientation = Instance.new("AlignOrientation",part)
- AlignPosition.Name = "PartAlignPos"
- AlignOrientation.Name = "PartAlignOri"
- local attachment0 = Instance.new("Attachment",part)
- local attachment1 = Instance.new("Attachment",part)
- attachment1.Name = "attachment1"
- AlignOrientation.RigidityEnabled = true
- AlignPosition.RigidityEnabled = true
- AlignOrientation.Attachment0 = attachment0
- AlignOrientation.Attachment1 = attachment1
- AlignPosition.Attachment0 = attachment0
- AlignPosition.Attachment1 = attachment1
- end
- if partname == "HumanoidRootPart" then
- part.Transparency = 1
- else
- part.Transparency = 0.5
- end
- --part.Position = partposition
- part.Name = partname
- part.Color = Color3.new(0, 0, 0)
- if part:GetNetworkOwner() ~= owner then
- part:SetNetworkOwner(owner)
- end
- end
- end,
- function(plr)
- if plr ~= owner then
- return
- end
- return conchar
- end
- }
- coms[1].Name = "Com1"
- coms[2].Name = "Com2"
- coms[3].Name = "Com3"
- waitremote.Name = "WaitRemote"
- coms[3].OnServerInvoke = comsfuncs[3]
- coms[2].OnServerInvoke = comsfuncs[2]
- coms[1].OnServerEvent:Connect(comsfuncs[1])
- NLS([==[
- local remote=script.Parent.Com1
- local com1 = script.Parent.Com2
- local owner = owner or game:GetService("Players").LocalPlayer
- local tweenservice = game:GetService("TweenService")
- game:GetService("RunService").RenderStepped:Connect(function()
- if owner.Character.Parent ~= workspace then
- owner.Character.Parent = workspace
- end
- end)
- local parttable={}
- local FF
- game:GetService("RunService").Stepped:Connect(function()
- if not FF then
- FF = Instance.new("ForceField")
- end
- if not FF.Parent then
- FF = nil
- end
- if FF then
- FF.Visible = false
- end
- for _, part in pairs(owner.Character:GetChildren()) do
- coroutine.resume(coroutine.create(function()
- local part = part
- if part:IsA("BasePart") then
- remote:FireServer(part.Name, part.Position, part.Size, part.Orientation)
- end
- end))
- end
- end)
- game:GetService("RunService").RenderStepped:Connect(function()
- if com1:InvokeServer() then
- for _,part in pairs(com1:InvokeServer():GetDescendants()) do
- coroutine.resume(coroutine.create(function()
- if part:IsA("BasePart") then
- part.CanCollide = false
- if part:FindFirstChild("attachment1") then
- part.attachment1.Parent = owner.Character[part.Name]
- part.Position = owner.Character[part.Name].Position
- end
- elseif part:IsA("Humanoid") then
- part:Destroy()
- end
- end))
- end
- end
- end)
- script.Parent.WaitRemote:FireServer()
- ]==],script)
- game:GetService("RunService").Heartbeat:Connect(function()
- for i=1,#coms do
- if not coms[i].Parent then
- local ClassName = coms[i].ClassName
- coms[i] = Instance.new(ClassName,script)
- if ClassName == "RemoteEvent" then
- coms[i].OnServerEvent:Connect(comsfuncs[i])
- elseif ClassName == "RemoteFunction" then
- coms[i].OnServerInvoke = comsfuncs[i]
- end
- end
- if coms[i].Name ~= "Com" .. tostring(i) then
- coms[i].Name = "Com" .. tostring(i)
- end
- end
- end)
- script.Parent = owner.PlayerGui
- print("waiting")
- waitremote.OnServerEvent:Wait()
- print("Destroy! wait remote")
- waitremote:Destroy()
- owner.Character.Parent = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement