There is Absolutely NO videos on yt on how to make an animation run with a remote event... Right now, I press "c" and nothing happens. I've been trying and trying to make this work but nothing does. Pls help
This is my localScript
--LocalPlayer's Camera
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local character = player.Character
--Crouch Animation
local mouse = player:GetMouse()
local Humanoid = player.Character:FindFirstChild('Humanoid')
local CrouchEvent = game:GetService("ReplicatedStorage"):WaitForChild("CrouchEvent")
local AlreadyCrouched = false
CrouchEvent.OnClientEvent:Connect(function()
mouse.KeyDown:Connect(function(Key)
if Key == "c" and AlreadyCrouched == false then
Humanoid.CameraOffset = Vector3.new(0, -1.2, -1.5)
CrouchEvent:FireServer()
AlreadyCrouched = true
print("Crouched")
elseif Key == "c" and AlreadyCrouched == true then
Humanoid.CameraOffset = Vector3.new(0, 0.2, -1.5)
AlreadyCrouched = false
print("unCrouched")
end
end)
end)
This is my Script
local CrouchEvent = game:GetService("ReplicatedStorage"):WaitForChild("CrouchEvent")
CrouchEvent.OnServerEvent:Connect(function()
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=4835659821"
CrouchEvent:FireClient()
end)

2 comments
Please use UserInputService's .InputBegan event instead. Mouse.KeyDown is a deprecated RBXScriptSignal
This code is what I had before except when I go in game (with 2 accounts) and check. It doesn't show the animation.