2 months ago

How to create a crouch localscript in StarterPlayer.StarterCharacterScripts in article >_<

(make it so that the player can't move if u want :<)


local UserInputService = game:GetService("UserInputService")

local Players = game:GetService("Players")

local player = Players.LocalPlayer

local character = player.Character or player.CharacterAdded:Wait()

local humanoid = character:WaitForChild("Humanoid")

local crouching = false

local normalWalkSpeed = 16

local crouchWalkSpeed = 8

local crouchAnimation = Instance.new("Animation")

crouchAnimation.AnimationId = "rbxassetid://CROUCHANIMATIONID"

local crouchTrack = humanoid:LoadAnimation(crouchAnimation)

UserInputService.InputBegan:Connect(function(input, gameProcessed)

if gameProcessed then return end

if input.KeyCode == Enum.KeyCode.C then

crouching = not crouching

if crouching then

humanoid.WalkSpeed = crouchWalkSpeed

crouchTrack:Play()

else

humanoid.WalkSpeed = normalWalkSpeed

crouchTrack:Stop()

end

end

end)



0 comments

Loading...

Next up

Can't stop larping

Anton lundin!!!

Came back after months just to make this lol

I can't stop larping

Made a crouch script

Short intro of us 💕✌️

We're an eletro duo based in Seoul 🇰🇷 Heavily influenced by the 90s.

Our new album #Xennials is all about the nostalgia of that era 💽 CD listenin 📟 beeper beepin 💾 floppy disks floppin days 😎

Stream now! 🎧

https://open.spotify.com/album/3YwWhnHWVy5cA8XOpbaGRA?si=8E9awqU…

Just as Pecaminosa's musicians #improvise this rendition of #LittleSunflower 🌻, so do we improvise with this post you're reading. 😂

What's coming out of your own improvs? 🤔

#Pecaminosa | #IndieDev | #OST | #Jazz

Smile! Here, take some happy pills! ✨💊 #Blender #3DModelling #3DArt Buy me a Ko-fi: https://ko-fi.com/barbarafb_