How to fix that?

hi all guys, im tryin to make a new game,but i have a bug,here video of buggy
robloxapp-20240801-1808292.wmv (3.1 MB)

how to fix that? im new in scriptin,and i tryed stop all anims,but idle is too stoping,im just need to stop anim from script (local script) this all, thanks for feedback!

1 Like

The MP4 didnt load btw
There are a number of things that could be causing this, so:

  • 1 . Are you using a custom movement system?
    1. Whats the code for the sword?

My guess is that the sword is probably goofing up something, so in the video, is the problem the walk anim is still playing or that you cant move?
WE NEED MORE CONTEXT!

1 Like

Hi,using custom walking sytem

here code of attack anims and etd.

local i = script.idle
local a = script.attack
local e = script.equip

local hum = game.Players.LocalPlayer.Character:WaitForChild(“Humanoid”)

local run_sc = game.Players.LocalPlayer.Character:WaitForChild(“Bruh”)

local idle = hum:LoadAnimation(i)
local equip = hum:LoadAnimation(e)
local attack = hum:LoadAnimation(a)

local pl = script.Parent

local handl = pl.Handle

local eq_sound = handl.equip
local eq_supp = handl.zap

local sw_sound = handl.swing
local sw_supp = handl.laser

–wait(0.2) swin
–wait(0.5) equip supp

pl.Equipped:Connect(function()
hum.WalkSpeed = 0
run_sc.Enabled = false
pl.Enabled = false
equip:Play()
idle:Play()
eq_sound:Play()
wait(0.5)
eq_supp:Play()
wait(1)
pl.Enabled = true
hum.WalkSpeed = 11
run_sc.Enabled = true
end)

pl.Unequipped:Connect(function()
equip:Stop()
idle:Stop()
attack:Stop()
end)

pl.Activated:Connect(function()
attack:Play()
run_sc.Enabled = false
pl.Enabled = false
hum.WalkSpeed = 0
wait(0.2)
sw_sound:Play()
wait(0.6)
sw_supp:Play()
wait(1.7)
pl.Enabled = true
run_sc.Enabled = true
hum.WalkSpeed = 11
end)

and here code of sprinting system:
(script in startercharacterscript)

local y = Enum.KeyCode.LeftShift
local UIS = game:GetService(“UserInputService”)
local RUN = Instance.new(“Animation”)
RUN.AnimationId = “rbxassetid://18440884465”
local Player = game.Players.LocalPlayer
local trackin = Player.Character.Humanoid:LoadAnimation(RUN)

UIS.InputBegan:Connect(function(input)
if input.KeyCode == y then
if Player.Character.Humanoid.MoveDirection.Magnitude > 0 then
Player.Character.Humanoid.WalkSpeed = 17
trackin:Play()
end
end
end)

UIS.InputEnded:Connect(function(input)
if input.KeyCode == y then
Player.Character.Humanoid.WalkSpeed = game.StarterPlayer.CharacterWalkSpeed
trackin:Stop()
end
end)

if you need more info then reply me

2 Likes

and sword have more scripts,i can share this scripts too, im writting almost all scripts in weapons and etd.

2 Likes

in video i show that animtion not stoping when tool used because of 0 walkspeed and when shift is pressed and not pressing,anims play,and animation stop playin only on death this all. (sorry for bad english)

1 Like

btw i need to update game, and im just delete part of script in animations that make character not moving,and i have custom down system,all working but when equip ToolGrip6D is have error in ouput i already fixed that, im making all system myself, also sword is working normaly after that

i making this game by myself and im grab from forum only scripts that fix problem, maybe im just make goofy code and now is just bad working.

this some context

1 Like

Don’t use wait(). it can yield and then script stops, also try to use Tab in every scope, it will make your code redable and more eye friendly. Also you have idle:Stop() in tool unequiping event soo keep that in mind.

Last thing that i should tell is that i made manual, now it have like 26-27 tutorials about from beginer to decent coding, check it out it might help in few cases: Scripting Manual

What is the run_sc variable referring to?

1 Like

running system script, this all

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.