#Catching
1 messages · Page 1 of 1 (latest)
this is the script where when its touched it catches
heres the script that makes the ball disappear
you want it so that it catches when the player touches it, but when the player touches it the player also has to have left clicked recently
?
or do you want it so that the player has to click the ball itself to catch it
The player has to click to catch it
I have where the player clicks it plays a animation and creates a hitbox
But I can’t for the life of me change the football script
With that second script it makes it where I have to click to catch but when I click it it disappears
wait so do you want it to be that when you click it creates a hitbox for a bit, and only then, when a ball touches that hitbox, it'll be caught
and then what are you having an issue with
With this script when I click it disappears
The football
It doesn’t give me it back
I have it all working basically apart from it disappearing
It's kinda hard to read your code but you have your assigning correct and your tool is getting moved to the character so it could be something with your if statements where even though it is hitting the player it's not passing all the conditions. so I would just look back at your conditions, and check with the isclose() function to make sure that your code logic is correct. if you need I would just ask chatgpt to look over it, you should never have chatgpt write your code however it's a good thing once and a while to have it look at what your code is actually doing.
also, I see in your code that you assign variables often but you don't add the "local" prefix. Always do this, it can really decrease performance in roblox if you make everything be a global scope
Also in your code you nest a lot of conditions, like in the "throw" function instead of doing if tool:IsA('Tool') then and then the rest of your code. you should do if not tool:IsA('Tool') then return end
you should check out this vid
I like it a lot
or this short which is also helpful
Ok ty
** You are now Level 3! **
Sorry I can't help with the actual code but it's 2 am for me and I'm tired as shit, but I hope you find my advice helpful and you figure out your problem soon
** You are now Level 2! **
I’ll dm you if I fix it or I still can’t get it to work
much love
Yea it’s 12 for me I’m about to go to sleep