ok so i was working on my script but when it came to this part i tried to get help from my friends who know more about scripting than me but they cant help me either what the script is supposed to do is after activating the first part its supposed to spawn a beam but for some reason it gives no errors and it doesnt work help ;-;
mouse.KeyDown:connect(function(key)
if key == "z" then
local reee = Instance.new("Part",game.Players.LocalPlayer.Character)
reee.Anchored = true
reee.BrickColor = BrickColor.Black()
reee.Transparency = 0.75
reee.CanCollide = false
reee.CFrame = game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,2,5)
reee.Touched:connect(function(onTouched)
game.Players.LocalPlayer.Character.Humanoid.Health = -50
end)
game.Players.LocalPlayer.Character.Humanoid.Walkspeed = 0
wait(10)
reee:Destroy()
end
end)

1 comment
Why are you using KeyDown