I want to make player can’t see for a while when player got hit
local function Gothahahaha(Player)
local Character = Player.Character
local hitbox = script.HitBox:Clone()
hitbox.Parent = workspace
hitbox.CFrame = Character.PrimaryPart.CFrame * CFrame.new(0,0, (hitbox.Size.z/2)*-1)
local wee = Instance.new("WeldConstraint")
wee.Part0 = hitbox
wee.Part1 = Character.PrimaryPart
wee.Parent = hitbox
De:AddItem(hitbox,.65)
local ignorelist = {}
hitbox.Touched:Connect(function(hitted)
if hitted.Parent:FindFirstChild("HumanoidRootPart") and not hitted:IsDescendantOf(Character) then
local enemy = hitted.Parent
if (table.find(ignorelist,enemy)) == nil then
table.insert(ignorelist,enemy)
wait(.3)
enemy.Humanoid:TakeDamage(Damage)
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(1e6,1e6,1e6)
bv.Velocity = Character.PrimaryPart.CFrame.LookVector * 5
bv.Parent = enemy.PrimaryPart
De:AddItem(bv,.2)
script.ScreenGui:Clone().Parent = enemy
enemy.Humanoid:LoadAnimation(script.StarHit):Play()
end
end
end)
end