#help
44 messages · Page 1 of 1 (latest)
is this a serverscript?
also do hit.Parent
it doesnt matter but it makes it more clear
rename C to hit
no the type of script
what
no
i said what type of script
is it
yeah then keep it
like that
can you paste the code here?
local debounce = true
script.Parent.Touched:Connect(function(hit)
if debounce then
debounce = false
local char = hit.Parent
if char and char:FindFirstChild("Humanoid") then
local hum = char:FindFirstChild("Humanoid")
local anim = script.Parent.Animation.AnimationId
local animator = hum:WaitForChid("Animator")
local animTrack = hum:LoadAnimation(anim)
animTrack:Play()
task.wait(1)
debounce = true
end
end
end)
try this
@halcyon cipher
does it give an error
show error tho
it works?
oh wheres the error
oh LOL
WaitForChid
my bad
local debounce = true
script.Parent.Touched:Connect(function(hit)
if debounce then
debounce = false
local char = hit.Parent
if char and char:FindFirstChild("Humanoid") then
local hum = char:FindFirstChild("Humanoid")
local anim = script.Parent.Animation.AnimationId
local animator = hum:WaitForChild("Animator")
local animTrack = hum:LoadAnimation(anim)
animTrack:Play()
task.wait(1)
debounce = true
end
end
end)```
this will work
** You are now Level 3! **
no i just made a typo
you can copy this
?
i know why
local debounce = true
script.Parent.Touched:Connect(function(hit)
if debounce then
debounce = false
local char = hit.Parent
if char and char:FindFirstChild("Humanoid") then
local hum = char:FindFirstChild("Humanoid")
local anim = script.Parent.Animation
local animator = hum:WaitForChild("Animator")
local animTrack = hum:LoadAnimation(anim)
animTrack:Play()
task.wait(1)
debounce = true
end
end
end)```
you put animation id
not the animation itself
i removed that
try this one
it does?
oh np
btw
local animator = hum:WaitForChild("Animator")
remove this line
we never use it in the script
local debounce = true
script.Parent.Touched:Connect(function(hit)
if debounce then
debounce = false
local char = hit.Parent
if char and char:FindFirstChild("Humanoid") then
local hum = char:FindFirstChild("Humanoid")
local anim = script.Parent.Animation
local animTrack = hum:LoadAnimation(anim)
animTrack:Play()
animTrack.Stopped:Wait()
task.wait(1)
debounce = true
end
end
end)```
np
does it work?