local shield = game.ReplicatedStorage.shield:Clone()
game.Players.PlayerAdded:Connect(function(player)
local character = player.Character or player.CharacterAdded:Wait()
shield.Parent = character
local shieldIsOn = Instance.new("NumberValue", player)
shieldIsOn.Name = "BulletHit"
shieldIsOn.Value = 8
local weld = Instance.new("WeldConstraint")
while wait() do
if player.BulletHit.Value == 8 then
weld.Parent = character
weld.Part0 = shield
weld.Part1 = character.HumanoidRootPart
shield.Position = character.HumanoidRootPart.Position
shield:WaitForChild("IsInUse").Value = true
end
end
while wait() do
if player.BulletHit.Value <= 8 then
repeat
wait(1)
player.BulletHit.Value = player.BulletHit.Value + 1
until player.BulletHit.Value == 8
end
end
end)
while wait() do
if player.BulletHit.Value < 8 then
repeat
player.BulletHit.Value = player.BulletHit.Value + 1
wait(1)
until player.BulletHit.Value == 8
end
end
local shield = game.ReplicatedStorage.shield:Clone()
game.Players.PlayerAdded:Connect(function(player)
local character = player.Character or player.CharacterAdded:Wait()
shield.Parent = character
local shieldIsOn = Instance.new("NumberValue", player)
shieldIsOn.Name = "BulletHit"
shieldIsOn.Value = 8
local weld = Instance.new("WeldConstraint")
while wait() do
wait(1)
if player.BulletHit.Value < 8 then
player.BulletHit.Value = player.BulletHit.Value + 1
end
if player.BulletHit.Value == 8 then
weld.Parent = character
weld.Part0 = shield
weld.Part1 = character.HumanoidRootPart
shield.Position = character.HumanoidRootPart.Position
shield:WaitForChild("IsInUse").Value = true
end
end
end)