New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do i make when i play animation walkspeed will be 0 and every script will disable?

Asked by 10 days ago

I want to make my script that a punch animation when I press a key button the animation will play every script will disable and can't move anything?

Sorry For My Grammar.

local player = game.Players.LocalPlayer
local db = true
local damage = false

local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset?id=3641946843"

game.Players.LocalPlayer.Character:WaitForChild("RightHand").Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") and not db and not damage and hit.Parent.Humanoid ~= game.Players.LocalPlayer.Character.Humanoid then
        if game.Players.LocalPlayer.Character.Humanoid.Health > 0 then
            damage = true
            game.ReplicatedStorage.Punch:FireServer(hit.Parent.Humanoid)
        end
    end
end)

game:GetService("UserInputService").InputBegan:Connect(function(input, event)
    if input.KeyCode == Enum.KeyCode.E and db then
        db = false
        local playAnim = game.Players.LocalPlayer.Character:WaitForChild("Humanoid"):loadAnimation(anim)
        playAnim:Play()
        wait(0.8)
        damage = false
        db = true
    end
end)

1 answer

Log in to vote
0
Answered by 10 days ago

If you want to make local players walkspeed 0, then you can make RemoteEvent, FireServer and make passed players walkspeed 0.

I just don't understand which scripts do you want to disable and why

0
all script disable cause if i use sprint script animation will cancle OrewaKamidaa 37 — 10d
0
make object boolValue called AnimIsplaying and make it true when anymation playes, make sprint script to check constantly if AnimIsPlaying is true, and if it si it should now make player sprint, in other words it should only make player run, if AnimIsPlaying is false GooierApollo664 163 — 10d
0
make object boolValue called AnimIsplaying and make it true when anymation playes, make sprint script to check constantly if AnimIsPlaying is true, and if it si it should now make player sprint, in other words it should only make player run, if AnimIsPlaying is false GooierApollo664 163 — 10d
Ad

Answer this question