I want It so when you hold down C the camera shake side to side
but it seem the action will not take place....
may I have some help plz
Lines 22 - 37
local play = game.Players.LocalPlayer
local char = play.Character
local hum = char:WaitForChild("Humanoid")
local uis = game:GetService("UserInputService")
local use = false
local inuse = false
local charge = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("ChargeEvent")
local down = false
local cam = game.Workspace.CurrentCamera
uis.InputBegan:Connect(function(input,istyping)
if not istyping then
if input.KeyCode == Enum.KeyCode.C then
if inuse == false then
inuse = true
down = true
-------=local chargeanim = hum:LoadAnimation(script.ChargingAnimation)
while down == true do wait()
if down == false then
print("broke(Cam Shake)")
break
end
for i = 1,5 do wait()
print("shake")
cam.CFrame = cam.CFrame + Vector3.new(3,0,0)
end
for i = 1,5 do wait()
print("InverseShake")
cam.CFrame = cam.CFrame - Vector3.new(3,0,0)
end
end
end
end
end
end)
----=---------------=end
--- chargeanim:Play()
uis.InputEnded:Connect(function(input,istyping)
if not istyping then
if input.KeyCode == Enum.KeyCode.C then
if inuse == true then
inuse = false
down = false
---charge:FireServer(inuse)
print("upFromShake")
-------=chargeanim:Stop()
end
end
end
end)
when the Key is Up it breaks the loop...…….
