What is wrong with this script?
Player = script.Parent.Parent
mouse = Player:GetMouse()
run = game:GetService("RunService")
enable = false
function onKeyDown(key)
Key = key:lower()
if key == "z" then
if not enable then
enable = true
Shadow = game.Lighting.WeakWaterShadow:Clone()
Shadow2 = game.Lighting.WeakWaterShadow:Clone()
WeakWaterShadowDmg = script.WeakWaterShadowdmg:Clone()
WeakWaterShadowDmg2 = script.WeakWaterShadowdmg:Clone()
Shadow.CFrame = Player.Character.Torso.CFrame*CFrame.new(-10,0,0)
Shadow2.CFrame = Player.Character.Torso.CFrame*CFrame.new(10,0,0)
WeakWaterShadowDmg.Parent = Shadow
WeakWaterShadowDmg2.Parent = Shadow2
Shadow.Parent = Workspace
Shadow2.Parent = Workspace
wait(5)
game.Debris:AddItem(Shadow and Shadow2, 6)
enable = false
end
end
end
It shows no errors but still does not work, It is in a localscript in StarterPack. |