#Detect a player when he jumped (Local Script)
1 messages · Page 1 of 1 (latest)
local UIS = game:GetService("UserInputService")
local camera = game.Workspace.CurrentCamera
local event = game.ReplicatedStorage:WaitForChild("SprintEvent")
local tweens = game:GetService("TweenService")
local zoomOut = tweens:Create(camera, TweenInfo.new(0.5, Enum.EasingStyle.Back), {FieldOfView = 90})
local zoomIn = tweens:Create(camera, TweenInfo.new(0.5, Enum.EasingStyle.Back), {FieldOfView = 70})
local isOn = false
local plrs = game:GetService("Players")
local plr = plrs.LocalPlayer
local char = plr.Character
UIS.InputBegan:Connect(function(input, V)
if V then return end
if input.keyCode == Enum.KeyCode.LeftShift then
isOn = not isOn
if isOn then
zoomOut:Play()
event:FireServer("sprint")
else
zoomIn:Play()
event:FireServer("walk")
end
end
end)
You might have to use humanoid.Running function
Well, you want to detect the WalkSpeed right?
Oh nvm
Then it's humanoid.Jumping i assume
It's a function, like humanoid.Jumping:Connect(function()
end)
And then you would need to do what you want in this function
kk
but I need the humanoid
it doesn't wan
t
Try WaitForChild
Maybe local char = plr.Character or plr.CharacterAdded:Wait()