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)

6 comments
Delete line 7 and replace line 6 with: if key:lower()== "z" then
Is this in a localscript in somewhere that replicates to the client(e.g. StarterGui, StarterPack, etc..)
@User Doesn't work. @Goul It's a localscript inside starterpack.
If anyone could debug this, I would be very grateful and in debt to you.
I skim read the script and I doesn't see anything wrong except from the line 6 and 7 which I already pointed out.
@UserOnly16Characters Lines 6 & 7 are valid.