You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
for the script to only deal 30 dmg once -
What is the issue? Include screenshots / videos if possible!
My Video 18 - YouTube
you can see that when i attack the dmg is not 30, i think thats it is becuase of the hitbox touching multiple bodyparts
as well as this now when my bat touches a dummy it also deals dmg without needing to left click
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i have tried adding a wait after the dmg script but am not able to disable it
I am extremely new to scripting as you can see and am using tutorials
the script i used is from this video
How To Make A Sword On Roblox - YouTube
please ask me anything if i didnt clarify or anything
here is the script
local DebounceTable = {}
script.Parent:WaitForChild(“Hitbox”).Touched:Connect(function(objectThatTouchesTheHitbox)
if objectThatTouchesTheHitbox.Parent then
if objectThatTouchesTheHitbox.Parent:FindFirstChild(“Humanoid”) then
if DebounceTable[objectThatTouchesTheHitbox.Parent] == true then return end
DebounceTable[objectThatTouchesTheHitbox.Parent] = true
objectThatTouchesTheHitbox.Parent.Humanoid:TakeDamage(30)
wait(2)
DebounceTable[objectThatTouchesTheHitbox.Parent] = nil
end
end
end)
-- This is an example Lua code block