( I posted about this a few hours ago but I didn't get any help.)
Ok, so what I want to do is hit a stationary object, like a non-moving brick. I want to hit it with a tool that has a script in the Handle and has the same animation as a Linked Sword. Here's the script.
enabled = true
function onTouched(h)
if enabled == true then
if h.Name == "PUTIS" then -- The stationary object's name that the tool will hit
if h.Transparency ~= 1 then
enabled = false
h.Parent.Humanoid.Health = h.Parent.Humanoid.Health - 25 -- The stationary object has a humanoid. Whenever touched with the tool's handle, it will decrease by 25 health.
wait(1)
enabled = true
end
end
end
end
script.Parent.Touched:connect(onTouched)
There is no output error. For some reason, the script won't do anything when I'm (the player) is stationary and hitting the stationary object. This should work since the tool is moving, allowing the Touched script to activate, but it only works when the player himself/herself is moving. I'm looking for a fix to this problem or maybe an alternative solution that doesn't include a Touched script.

3 comments
No one was any help was what I meant
And did you even bother to check the new suggestion?
Oh, no. I'm sorry. Thanks for the script, too. I really appreciate it.