#how to make it where it only damages the player when the anim is fired

104 messages · Page 1 of 1 (latest)

mint verge
#

i did the wrong tag

#

crap

#

there i fixed it

worn pike
#

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.

mystic geyser
#

super helpful for me too

rough rootBOT
#

studio** You are now Level 3! **studio

mint verge
mint verge
mystic geyser
mint verge
#

your stealing code

#

thats annoying as hell

mystic geyser
#

ur dumb

mint verge
#

your father wasnt when he left you

#

he made the right choice

mystic geyser
#

i still have my father but he’s not around too often

mystic geyser
#

never much to talk about

#

he’s to invested in a capitalistic society

mint verge
#

i dont care about your daddy issues

mystic geyser
#

ok

#

so

#

what’s the point then

#

u had a point right

#

😕

#

thanks for helping me learn anyways

mint verge
#

do you ever shut the hell up

#

is that possible

mystic geyser
#

anything is possible

#

but can you make it happen

worn pike
#

@mint verge I wrote the code for everybody to use. @mystic geyser is welcome to use it as well

mystic geyser
worn pike
#
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()
mint verge
mint verge
rough rootBOT
#

studio** You are now Level 6! **studio

worn pike
#

@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.

rough rootBOT
#

studio** You are now Level 2! **studio

mystic geyser
mystic geyser
worn pike
#

@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.

mystic geyser
worn pike
#

ill put it all together

mystic geyser
#

ok

#

they might be kinda unnecessary

worn pike
#

its all good

mystic geyser
#

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

mint verge
#

glad we found the real side of the person 💀

mystic geyser
#

😹 😭 😂 🤣 🤣

mint verge
#

put it down

#

before it becomes more cursed

mystic geyser
#

😵 owocat

worn pike
#
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
mint verge
#

can yall post that in a different post bro

mystic geyser
#

why

mint verge
#

this is mine

#

go somewhere else

mystic geyser
#

:0

#

:(

worn pike
#

@mint verge just unfollow the post dumbass

mint verge
#

this post isnt for your random nonsense

mystic geyser
#

me when im on my random nonsense

mint verge
#

#1006356488912121967 is a good place for you 🥰

worn pike
# mint verge just create a new post dumbass

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?

mint verge
#

💀

mystic geyser
#

🦧

mint verge
#

bro has been typing for 8 hours im excited to see this one

mystic geyser
#

🍿

worn pike
#

Send me your game

#

I bet it looks like dogshit

mystic geyser
#

🫡

rough rootBOT
#

studio** You are now Level 4! **studio

worn pike
#

I could smash a few buttons on my keyboard and make a better game

#

"im a creature" so cringe LMAOOO

#

get a life

mint verge
mystic geyser
#

this is all i got

worn pike
mystic geyser
#

thank you i am good at illustrator

mint verge
mystic geyser
#

nto coding

mint verge
#

isnt that insane

mystic geyser
worn pike
#

@mystic geyser lets just keep typing here and ignore his stupid ass messages

#

give me a sec to fix the code

mystic geyser
#

👍

#

🎸 🦃