#how to make it where it only damages the player when the anim is fired
104 messages · Page 1 of 1 (latest)
It looks like the issue is that you are setting up a Touched event listener on the Right Arm object inside the event listener for the KeyDown event for the f key. This means that every time the f key is pressed, a new Touched event listener is added to the Right Arm, which means that whenever the Right Arm touches something, the game.ReplicatedStorage.Punch:FireServer(hit.Parent.Humanoid) line of code will be executed multiple times (once for each time the f key was pressed).
To fix this issue, you can move the Touched event listener outside of the KeyDown event listener, so that it is only added once. Then, you can use a variable to track whether or not the punch animation is currently playing, and only execute the code inside the Touched event listener if the punch animation is currently playing.
Here is an example of how you could modify your code to fix this issue:
This code sets up a Touched event listener on the Right Arm object, and only executes the code inside the Touched event listener if the punch animation is currently playing. This ensures that the code inside the Touched event listener is only executed once for each time the f key is pressed.
super helpful for me too
** You are now Level 3! **
bruh
stfu
why u mad
ur dumb
i still have my father but he’s not around too often
i dont care about your daddy issues
ok
so
what’s the point then
u had a point right
😕
thanks for helping me learn anyways
@mint verge I wrote the code for everybody to use. @mystic geyser is welcome to use it as well
thank u but i was never going to "steal" it or anything i just like to read this posts to learn
also fauna is goated
if you need help with anything let me know im pretty experienced
function sayHello()
-- create a local variable to store the string "hello"
local helloString = "hello"
-- create a function to print the helloString to the console
local function printHello()
print(helloString)
end
-- call the printHello function to print the helloString to the console
printHello()
end
-- call the sayHello function to execute the code
sayHello()
thats the most basic shit 💀
and i wrote the majority you just helped me fix it so its not really yours to giveaway 💀
** You are now Level 6! **
@mint verge The fuck you on about? I wrote the entirety of the code
Well, it's no wonder your dad left you at an early age if you're going to be rude to everyone who helps you out. If you keep acting like this, you'll end up pushing away everyone in your life and you'll be alone for the rest of it. Maybe take a deep breath and try to be a little more appreciative and grateful for the help you're receiving.
** You are now Level 2! **
DAMN
i hope your day gets better mr. creature
right now i am trying to learn about debounce and i also am trying to make it so one function cant happen while a different function is happening
@mystic geyser Like this?
local function doFunction1()
-- code for function 1
end
local function doFunction2()
-- code for function 2
end
-- create coroutines from the functions
local function1 = coroutine.wrap(doFunction1)
local function2 = coroutine.wrap(doFunction2)
-- check if the coroutines are running, and call them if they are not
if coroutine.status(function1) ~= "running" then
function1()
end
if coroutine.status(function2) ~= "running" then
function2()
end
The code above will ensure that doFunction1() and doFunction2() do not run at the same time. If one of the functions is already running when the code is executed, the other function will not be called until the first function has finished. This means that the two functions will not interfere with each other, and will be executed one at a time.
THANKS!!!!!!! but what do i put in "doFunction1" would i just put the name of my function?
Send me the two functions
ill put it all together
its all good
i asked someone else ab them and they said they seem ok
function ArenaButtonClick()
areb:TweenPosition(
UDim2.new(-2, 0,0.124, 0),
"Out",
"Quad",
1,
false
)
task.wait(.05)
advb:TweenPosition(
UDim2.new(-2, 0,0.283, 0),
"Out",
"Quad",
1,
false
)
task.wait(.05)
cusb:TweenPosition(
UDim2.new(-2, 0,0.438, 0),
"Out",
"Quad",
1,
false
)
task.wait(.05)
slob:TweenPosition(
UDim2.new(-2, 0,0.596, 0),
"Out",
"Quad",
1,
false
)
task.wait(.01)
solb:TweenPosition(
UDim2.new(0.048, 0,0.138, 0),
"Out",
"Quad",
1,
false
)
duob:TweenPosition(
UDim2.new(0.248, 0,0.138, 0),
"Out",
"Quad",
1,
false
)
task.wait(.05)
custb:TweenPosition(
UDim2.new(0.048, 0,0.296, 0),
"Out",
"Quad",
1,
false
)
task.wait(.05)
bacb:TweenPosition(
UDim2.new(0.048, 0,0.456, 0),
"Out",
"Quad",
1,
false
)
ranb:TweenPosition(
UDim2.new(0.248, 0,0.456, 0),
"Out",
"Quad",
1,
false
)
task.wait(.01)
script.Parent.Enabled = true
Main = true
end
function BackButtonClick()
bacb:TweenPosition(
UDim2.new(-4, 0,0.456, 0),
"Out",
"Quad",
1.5,
false
)
ranb:TweenPosition(
UDim2.new(-2, 0,0.456, 0),
"Out",
"Quad",
1.5,
false
)
task.wait(.05)
custb:TweenPosition(
UDim2.new(-2, 0,0.296, 0),
"Out",
"Quad",
1.5,
false
)
task.wait(.05)
solb:TweenPosition(
UDim2.new(-4, 0,0.138, 0),
"Out",
"Quad",
1.5,
false
)
duob:TweenPosition(
UDim2.new(-2, 0,0.138, 0),
"Out",
"Quad",
1.5,
false
)
task.wait(.01)
areb:TweenPosition(
UDim2.new(0.079, 0,0.124, 0),
"Out",
"Quad",
1,
false
)
task.wait(.05)
advb:TweenPosition(
UDim2.new(0.08, 0,0.283, 0),
"Out",
"Quad",
1,
false
)
task.wait(.05)
cusb:TweenPosition(
UDim2.new(0.08, 0,0.438, 0),
"Out",
"Quad",
1,
false
)
task.wait(.05)
slob:TweenPosition(
UDim2.new(0.08, 0,0.596, 0),
"Out",
"Quad",
1,
false
)
task.wait(.01)
script.Parent.Enabled = false
Main = false
end
damn that wentt from 1 - 9 fast 
glad we found the real side of the person 💀
😹 😭 😂 🤣 🤣
that cat looks cursed
put it down
before it becomes more cursed
😵 
function BackButtonClick()
bacb:TweenPosition(UDim2.new(-4, 0,0.456, 0), "Out", "Quad", 1.5, false)
ranb:TweenPosition(UDim2.new(-2, 0,0.456, 0), "Out", "Quad", 1.5, false)
task.wait(0.05)
custb:TweenPosition(UDim2.new(-2, 0,0.296, 0), "Out", "Quad", 1.5, false)
task.wait(0.05)
solb:TweenPosition(UDim2.new(-4, 0,0.138, 0), "Out", "Quad", 1.5, false)
duob:TweenPosition(UDim2.new(-2, 0,0.138, 0), "Out", "Quad", 1.5, false)
task.wait(0.01)
areb:TweenPosition(UDim2.new(0.079, 0,0.124, 0), "Out", "Quad", 1, false)
task.wait(0.05)
advb:TweenPosition(UDim2.new(0.08, 0,0.283, 0), "Out", "Quad", 1, false)
task.wait(0.05)
cusb:TweenPosition(UDim2.new(0.08, 0,0.438, 0), "Out", "Quad", 1, false)
task.wait(0.05)
slob:TweenPosition(UDim2.new(0.08, 0,0.596, 0), "Out", "Quad", 1, false)
task.wait(0.01)
script.Parent.Enabled = false
Main = false
end
this isnt the completed code just pasting here for a sec
function ArenaButtonClick()
areb:TweenPosition(UDim2.new(-2, 0,0.124, 0), "Out", "Quad", 1, false)
task.wait(0.05)
advb:TweenPosition(UDim2.new(-2, 0,0.283, 0), "Out", "Quad", 1, false)
task.wait(0.05)
cusb:TweenPosition(UDim2.new(-2, 0,0.438, 0), "Out", "Quad", 1, false)
task.wait(0.05)
slob:TweenPosition(UDim2.new(-2, 0,0.596, 0), "Out", "Quad", 1, false)
task.wait(0.01)
solb:TweenPosition(UDim2.new(0.048, 0,0.138, 0), "Out", "Quad", 1, false)
duob:TweenPosition(UDim2.new(0.248, 0,0.138, 0), "Out", "Quad", 1, false)
task.wait(0.05)
custb:TweenPosition(UDim2.new(0.048, 0,0.296, 0), "Out", "Quad", 1, false)
task.wait(0.05)
bacb:TweenPosition(UDim2.new(0.048, 0,0.456, 0), "Out", "Quad", 1, false)
ranb:TweenPosition(UDim2.new(0.248, 0,0.456, 0), "Out", "Quad", 1, false)
task.wait(0.01)
script.Parent.Enabled = true
Main = true
end
can yall post that in a different post bro
why
@mint verge just unfollow the post dumbass
just create a new post dumbass
this post isnt for your random nonsense
me when im on my random nonsense
#1006356488912121967 is a good place for you 🥰
Why don't you try coming up with some original insults? Or is that too hard, considering you can't even come up with original code, and you have to ask very basic questions on Discord?
And she says i'm the one who can't think of insults
💀
🦧
bro has been typing for 8 hours im excited to see this one
🍿
Shut the fuck up, you aren't funny and nobody likes you. You are obviously a 12/13 year old trying to make to next "big" ROBLOX game, but you are going to fail horribly. You are probably one of "da boyzzz" because you use 🤡 and 💀.
Send me your game
I bet it looks like dogshit
🫡
** You are now Level 4! **
I could smash a few buttons on my keyboard and make a better game
"im a creature" so cringe LMAOOO
get a life
How about you shut the fuck up, because i don't have to do a fucking thing. this is MY post, and you can get the fuck out. Nobody wants to see your shitty ass uwu face looking girl avatar, nor nobody wants to see your idiotic messages
Damn that actually looks sexy af
thank you i am good at illustrator
this would be awesome to post somewhere else
nto coding
isnt that insane
my fault