Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ApplyForceField(character, forcefield, duration)
- local attachto = character:FindFirstChild("HumanoidRootPart")
- if attachto then
- if forcefield ~= nil then
- print("MakeFF")
- forcefield.Visible = false
- local MainFFPart = Instance.new("Part")
- MainFFPart.Parent = character
- MainFFPart.Size = Vector3.new(7,7,7)
- MainFFPart.Color = Color3.fromRGB(0, 16, 176)
- MainFFPart.Shape = "Ball"
- MainFFPart.TopSurface = "Smooth"
- MainFFPart.BottomSurface = "Smooth"
- MainFFPart.Transparency = 0.8
- MainFFPart.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0)
- MainFFPart.CanCollide = false
- MainFFPart.Position = attachto.Position
- game:GetService("Debris"):AddItem(MainFFPart, duration)
- local SecondaryFFPart = Instance.new("Part")
- SecondaryFFPart.Parent = MainFFPart
- SecondaryFFPart.Size = Vector3.new(7.5,7.5,7.5)
- SecondaryFFPart.Color = Color3.fromRGB(0, 16, 176)
- SecondaryFFPart.Shape = "Ball"
- SecondaryFFPart.TopSurface = "Smooth"
- SecondaryFFPart.BottomSurface = "Smooth"
- SecondaryFFPart.Transparency = 1
- SecondaryFFPart.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0)
- SecondaryFFPart.CanCollide = false
- SecondaryFFPart.Position = attachto.Position
- local MainFFWeld = Instance.new("Weld")
- MainFFWeld.Parent = MainFFPart
- MainFFWeld.Part0 = MainFFPart
- MainFFWeld.Part1 = attachto
- local SecondaryFFWeld = Instance.new("Weld")
- SecondaryFFWeld.Parent = SecondaryFFPart
- SecondaryFFWeld.Part0 = SecondaryFFPart
- SecondaryFFWeld.Part1 = MainFFPart
- while true do
- for i = 1,10 do
- wait(0.05)
- MainFFPart.Transparency = MainFFPart.Transparency + 0.05
- SecondaryFFPart.Transparency = SecondaryFFPart.Transparency - 0.05
- end
- for i = 1,10 do
- wait(0.05)
- MainFFPart.Transparency = MainFFPart.Transparency - 0.05
- SecondaryFFPart.Transparency = SecondaryFFPart.Transparency + 0.05
- end
- end
- end
- end
- end
- function PlayerAdded(player)
- local function CharacterAdded(character)
- local ff = Instance.new("ForceField")
- ff.Parent = character
- game:GetService("Debris"):AddItem(ff, 10)
- ApplyForceField(character, ff, 10)
- end
- player.CharacterAdded:Connect(CharacterAdded)
- end
- for i,v in pairs(game.Players:GetChildren()) do
- PlayerAdded(v)
- end
- game.Players.PlayerAdded:Connect(PlayerAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement