Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Exoshield - Made by Despairus ]]
- script.Parent = nil
- script.Name = "Exoshield"
- Username = "PrinceOfHeaven" -- PUT YOUR NAME HERE
- local RS = game:GetService("RunService")
- function getparts(t, range, location)
- local parts = {}
- for _a,a in pairs(location:GetChildren()) do
- if (a.Name ~= "ExoShield") then
- if (a:IsA("BasePart")) then
- if ((a.Position-t.Position).magnitude <= range) then--[[ and (a.Position-t.Position).magnitude > (range/1.5)) then]]
- table.insert(parts, a)
- end
- elseif (a.ClassName == "Model" and a ~= t.Parent) then
- if (a:FindFirstChild("Torso") and a:FindFirstChild("Humanoid")) then
- if ((a.Torso.Position-t.Position).magnitude <= range) then--[[ and (a.Position-t.Position).magnitude > (range/1.5)) then]]
- table.insert(parts, a.Torso)
- end
- end
- end
- end
- end
- return parts
- end
- CreateExoShield = function(User)
- if User ~= nil then
- if User.Character ~= nil then
- if User.Character:FindFirstChild("Exoshield") == nil then
- local rendercon = nil
- local distance = 8
- local mode = "barrier"
- local angle = 0
- local _e1,e1 = 0,false
- local shield = Instance.new("Part")
- local light = Instance.new("PointLight")
- local forcefield = Instance.new("Part")
- local spheremesh = Instance.new("SpecialMesh")
- local m = Instance.new("Model")
- while coroutine.yield() do --[[rendercon = RS.Heartbeat:connect(function()]]
- if User == nil then rendercon:disconnect() end
- if (angle < 100) then angle = angle + .03 else angle = 0 end
- if m == nil then m = Instance.new("Model") end
- if shield == nil then shield = Instance.new("Part") end
- if light == nil then light = Instance.new("PointLight") end
- if forcefield == nil then forcefield = Instance.new("Part") end
- if spheremesh == nil then spheremesh = Instance.new("SpecialMesh") end
- m.Parent = game.Workspace
- m.Name = "ExoShield"
- shield.Parent = m
- shield.FormFactor = "Custom"
- shield.BottomSurface = 0
- shield.Material = "DiamondPlate"
- shield.TopSurface = 0
- shield.Name = "Shield"
- shield.BrickColor = BrickColor.new("Toothpaste")
- shield.Locked = true
- shield.Size = Vector3.new(6+(_e1/14),.6+(_e1/18),6+(_e1/14))
- shield.Anchored = true
- shield.Velocity = Vector3.new(0,0,-200)
- shield.Transparency = (1 - (_e1 * .03))
- light.Parent = shield
- forcefield.Parent = m
- forcefield.Name = "ForceField"
- forcefield.FormFactor = "Custom"
- forcefield.Material = "Slate"
- forcefield.CanCollide = false
- forcefield.Size = Vector3.new((distance*2)+(_e1/16),(distance*2)+(_e1/16),(distance*2)+(_e1/16))
- forcefield.Anchored = true
- forcefield.Locked = true
- forcefield.BottomSurface = 0
- forcefield.TopSurface = 0
- forcefield.BrickColor = BrickColor.new("Really black")
- forcefield.Transparency = (1 - (_e1 * .04))
- spheremesh.Parent = forcefield
- spheremesh.MeshType = "Sphere"
- if e1 then
- _e1=_e1-.3
- else
- _e1=_e1+.3
- end
- if (_e1 < 0) then
- e1 = false
- elseif (_e1 > 10) then
- e1 = true
- end
- if User.Character ~= nil then
- for _,v in pairs(User.Character:GetChildren()) do
- local c = v.ClassName
- if (v:IsA("BasePart")) then
- v.Material = "Marble"
- v.BrickColor = BrickColor.new("Black")
- if (v.Name == "Head" and User.Character:findFirstChild("Fakehead") == nil) then
- if (v:findFirstChild("face")) then
- v.face:Destroy()
- end
- local fakehead = v:Clone()
- fakehead.Name = "Fakehead"
- fakehead.Parent = User.Character
- local w = Instance.new("Weld", v)
- w.Part0 = v
- w.Part1 = fakehead
- v.Transparency = 1
- end
- elseif (c == "Hat" or c == "Shirt" or c == "Pants") then
- v:Destroy()
- elseif (c == "Humanoid") then
- v.MaxHealth = 999999999
- v.Health = v.MaxHealth
- v.WalkSpeed = 30
- v.PlatformStand = false
- v.Sit = false
- v.Jump = false
- end
- end
- local t = User.Character:FindFirstChild("Torso")
- if t ~= nil then
- if (mode == "barrier") then
- local objects,x,y,z = getparts(t,distance,Workspace),0,0,0
- if (#objects > 0) then
- for _,v in pairs(objects) do
- shield.CFrame = CFrame.new(t.Position, v.Position) * CFrame.new(0,0,-distance/2) * CFrame.Angles(math.pi/2,0,0)
- end
- else
- x = math.sin(angle / math.pi*2) * (distance/2)
- z = math.cos(angle / math.pi*2) * (distance/2)
- y = 0 --[[ Todo; add rotation to y matrix ]]
- shield.CFrame = CFrame.new(t.Position, t.Position+Vector3.new(x,y,z)) * CFrame.new(0,0,-distance) * CFrame.Angles(math.pi/2,0,0)
- end
- forcefield.CFrame = t.CFrame
- end
- end
- end
- end --[[ END LOOP ]]
- end
- end
- end
- end
- CreateExoShield(game.Players[Username])
- game.Players[Username].Chatted:connect(function(msg)
- if (string.sub(msg:lower(), 1, 7) == "shield ") then
- local name = string.sub(msg:lower(), 8)
- for _,v in pairs(game.Players:GetPlayers()) do
- if (string.find(v.Name:lower(), name)) then
- CreateExoShield(v)
- end
- end
- end
- end)
Add Comment
Please, Sign In to add comment