A game file so we can actually see where the humanoid and other things are located without you having to explain it. You don’t have to if it has parts of your game that you don’t want to show.
only can build the script when playing, ima send you the game file right away just dont reupload it lol
No, don’t send it to me
My studio isn’t working like I said before.
i’ll try this
debounce = false
script.Parent.Equipped:Connect(function(Mouse)
game.Workspace.Player.Humanoid.Running:Connect(function(speed)
if script.parent.Parent.Humanoid.WalkSpeed > 0 then
print("Player is running")
else
wait(8)
if debounce == false then
debounce = true
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Idle)
animation:Play()
wait(1.5)
debounce = false
print('Speer Operator is now Idle!')
end
end
script.Parent.Unequipped:Connect(function()
animation:Stop()
print('Speer Unequipped, animation stopped!')
end)
end)
end)
well now the output is " 08:41:19.040 - Player is not a valid member of Workspace"
the error is at
debounce = false
script.Parent.Equipped:Connect(function(Mouse)
game.Workspace.Player.Humanoid.Running:Connect(function(speed)
Is it your avatar or a rig? If it is your avatar, then replace player with your players name. You can change this to be the player who is holding the spear later.
its a tool that should play animation when a player is idle for an exceeding time
ima try to just remove the " game.Workspace.Player.Humanoid.Running:Connect(function(speed)" as it was part of the method i used before
Try just removing “Player” and do your username. Not the whole thing.
well but then it would only be detecting me right, and it was part of the older method, is it still worth existing?
I am assuming that your script is a local script?
removed it, but now it only reaches print(‘player is running!’) it wont go further when i stop
oh and yes its local
oof, it thinks im running as soon as i equip it
Is it continuously running as soon as you run and equip, or is it a one-off?
noo, the script prints “Player is running” just when i equip it, even tho im standing completely still (when equipping it the speer touches the ground for 1s causing the player to bounce a tiny bit)
but even then it is never printing that it stoppped moving
Try a while true statement and add a wait() at the end of the while loop. While around the whole script.
hmmmmm, and how exactly do i build that up?
like (not a correct script form, just how its going to be built up):
if speed >0 (under 0) then
wait(8)
if debounce == false then
debounce = true
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Idle)
animation:Play()
wait(1.5)
debounce = false
print('Speer Operator is now Idle!')
end
end
while true do print("Player is running")
Above the debounce on this post.
Do “while true do” above, don’t forget the “end” (no brackets after end!)
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
hum.Running:Connect(function(speed)
if speed == 0 then
-- Code
end
end)
oh! thank you alot, i’ll check it out, and where do i input the thing with it stopping etc?
It was == 0 like above. Sorry! > is for bigger