Okay, so for some reason, this onKeyDown script won't work. It doesn't say anything in the output and I've already tested it in a live game...
player = game.Players.LocalPlayer char = player.Character mouse = player:GetMouse() mouse.KeyDown:connect(function(key) key = key:lower() if key == "z" then local hole = Instance.new("Part", char) local holemesh = Instance.new("CylinderMesh", hole) hole.FormFactor = "Custom" hole.Anchored = true hole.CanCollide = false hole.BrickColor = BrickColor.new("Really black") local script = script.Script:Clone() script.Parent = hole script.Disabled = false char.Torso.Anchored = true for i = 1, 100 do hole.Size = Vector3.new(i, 0.2, i) hole.CFrame = char.Torso.CFrame * CFrame.new(0, -2.8, 0) wait(0.025) end game.Debris:AddItem(hole, 2) wait(0.025) char.Torso.Anchored = false end end)
And if it matters, the damage script.
script.Parent.Touched:connect(function(toucher) local humanoid = toucher.Parent:FindFirstChild("Humanoid") if humanoid then if toucher.Parent.Name ~= script.Parent.Parent.Name then toucher.Parent.Torso.Anchored = true toucher.Parent.Torso.CanCollide = false toucher.Parent["Right Leg"].CanCollide = false toucher.Parent["Left Leg"].CanCollide = false for i = 0, 0.5, 0.1 do toucher.Parent.Torso.CFrame = toucher.Parent.Torso.CFrame * CFrame.new(0, -i, 0) wait(0.5) end humanoid.Health = humanoid.Health - 25 end end end)
I recommend you to fix:
First Script - Lines 1 & 2, line 10, & lines 14-16
Second Script - Lines 5-8
repeat wait() until game.Players.LocalPlayer Player = game.Players.LocalPlayer Character = Player.Character if not Character then Character = Player.CharacterAdded:wait() -- This is added to wait until the character model is not nil. end
hole.FormFactor = Enum.FormFactor.Custom
local DamageScript = script.Script:Clone() DamageScript.Parent = hole DamageScript.Disabled = false
hole
has arms/legs. A character model can still function without them.local RightLeg = toucher.Parent:FindFirstChild("Right Leg") if RightLeg then RightLeg.CanCollide = false end local LeftLeg = toucher.Parent:FindFirstChild("Left Leg") if LeftLeg then LeftLeg.CanCollide = false end
repeat wait() until game.Players.LocalPlayer Player = game.Players.LocalPlayer Character = Player.Character if not Character then Character = Player.CharacterAdded:wait() end Mouse = Player:GetMouse() DamageScript = script.Script Mouse.KeyDown:connect(function (key) key = key:lower() if key == "z" then local Torso = Character:FindFirstChild("Torso") local hole = Instance.new("Part", Character) local holemesh = Instance.new("CylinderMesh", hole) hole.FormFactor = Enum.FormFactor.Custom hole.Anchored = true hole.CanCollide = false hole.BrickColor = BrickColor.new("Really Black") local DamageScriptClone = DamageScript:Clone() DamageScriptClone.Parent = hole DamageScriptClone.Disabled = false game.Debris:AddItem(hole, 2) if Torso then Torso.Anchored = true for i = 1, 100 do hole.Size = Vector3.new(i, .2, i) hole.CFrame = Torso.CFrame * CFrame.new(0, -2.8, 0) wait(.025) end wait(.025) Torso.Anchored = false end
script.Parent.Touched:connect(function (hit) local Victim = hit and hit.Parent local Humanoid = Victim and Victim:FindFirstChild("Humanoid") if Humanoid then if Victim.Name ~= script.Parent.Parent.Name then local Torso = Victim:FindFirstChild("Torso") local RightLeg = Victim:FindFirstChild("Right Leg") local LeftLeg = Victim:FindFirstChild("Left Leg") if RightLeg then RightLeg.CanCollide = false end if LeftLeg then LeftLeg.CanCollide = false end if Torso then Torso.Anchored = true Torso.CanCollide = false for i = 0, .5, .1 do Torso.CFrame = Torso.CFrame * CFrame.new(0, -i, 0) wait(.5) end end Humanoid.Health:TakeDamage(25) end end end