Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RS = game:GetService("ReplicatedStorage")
- local TweenService = game:GetService("TweenService")
- local Shield = RS.Shield
- local InfoTween = TweenInfo.new(1, Enum.EasingStyle.Sine)
- local v1 = {}
- RS.Block.OnServerEvent:Connect(function(Player, Statement)
- local Character = Player.Character
- local Humanoid = Character.Humanoid
- if Statement == "On" and not v1[Player] then
- Character:WaitForChild("Data").IsBlocking.Value = true
- local NewShield = Shield:Clone()
- local WeldCon = Instance.new("WeldConstraint", NewShield)
- NewShield.Parent = game.Workspace
- v1[Player] = NewShield
- NewShield.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-3)
- WeldCon.Part0 = Character.HumanoidRootPart
- WeldCon.Part1 = NewShield
- TweenService:Create(NewShield,InfoTween, {Transparency = 0, Color = Color3.fromRGB(99, 99, 99);}):Play()
- elseif Statement == "Off" and v1[Player] then
- Character:WaitForChild("Data").IsBlocking.Value = false
- TweenService:Create(v1[Player],InfoTween, {Transparency = 1,Color = Color3.fromRGB(255, 255, 255);}):Play()
- wait(1)
- v1[Player]:Destroy()
- v1[Player] = nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement