Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this script not run?

Asked by 8 years ago

The error I am getting is: 18:53:08.625 - Players.Player.Backpack.Natsu.KeyDownF:12: attempt to perform arithmetic on global 'l' (a nil value) 18:53:08.627 - Stack Begin 18:53:08.630 - Script 'Players.Player.Backpack.Natsu.KeyDownF', Line 12 18:53:08.631 - Stack End

bin = script.Parent
local player = game.Players.Localplayer
enabled = true
function onKeyDown(key) 
key:lower() 

if key == "f" then

if player.Magic.Value <= player.MaxMagic.Value then
RightShoulder = player.Character.Torso["Right Shoulder"]
LeftShoulder =  player.Character.Torso["Left Shoulder"]
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(0,0,-1.6)
for i=1, 2 do
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(0.4,0,0)
RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(0,0.4,0)
wait()
end
for i=1, 2 do
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(0,0.1,0)
RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(0,0.1,0)
wait()
end
x = Instance.new("Smoke")
x.RiseVelocity = 3
x.Size = 3
x.Color = Color3.new(0.25, 0.5, 1)
x.Parent = player.Character.Torso
for i = 1,25 do
if player.Magic.Value <= player.MaxMagic.Value then
player.Magic.Value = player.Magic.Value +2
end
wait()
end
for i=1, 2 do
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(0,-0.1,0)
RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(0,-0.1,0)
wait()
end
for i=1, 2 do
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(-0.4,0,0)
RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(0,-0.4,0)
wait()
end
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(0,0,1.6)
x:remove()
end
end
end
function onSelected(mouse) 
mouse.KeyDown:connect(onKeyDown) 
end 

script.Parent.Selected:connect(onSelected)



0
is this the full script? koolkid8099 705 — 8y

Answer this question