#If I want to cause knockback on a player in a specific direction what should I use?

137 messages · Page 1 of 1 (latest)

warm valley
#

bodyvelocity is deprecated, linearvelocity replaced it

#

if you saw that video, follow the same steps but use linearvelocity

#

i have no clue but if the parent is null it probably doesnt exist

#

try googling

#

never seen that before

#

maybe you forgot to parent it somewhere?

#

parent property of snowball is locked

#

huh

#

thats weird

#

i have never seen that

#

if a thing's parent is nil it will be deleted

#

i think

#

thats what :destroy() does

#

i found something

#

@warm valley

#

a :Destroy() somewhere is firing and locking the parent property

#

probably i dont know but that popped up

#

when you click

#

what's winterwipeout?

#

the tool might be getting destroyed before the snowball can properly fire

#

this is probably the culprit

#

try changing .5 to a bigger number for testing purposes

#

also wont it better to only destroy until the snowball exists instead of relying on task.wait?

#

im not that good at scripting either so im having an equal aneurysm as you

#

what's Db in the local

#

but does the snowball fire?

#

no what does Db mean

#

ah

#

right so wont it be better if

#
wait(.5)
if Db then
  Snowball:Destroy()
end```
#

probably something with the firevent thing

#

i have no clue how to use those

#

maybe you could try and find a snowball script somewhere and analyze that first

#

you figured it out?

#

move the serverscript to serverscriptservice

#

yeah try it out

#

i think so yeah

#

do not use spawn function

#

spawn thing

#

spawn is evil

#

it's unreliable

#

use coroutines instead

#

coroutine.wrap(function()
end)()

#

it's better than spawn because spawn get's clogged and it isn't guaranteed to resume the script

warm valley
#

yes

#

probably

#

i say probably because

#

wait actually nevermind

#

i take back that probably

#

also

#

coroutine.wrap is create and finish

#

in one

#

i have no clue because i have never used coroutines

#

but yeah that should work for whatever you use it for

#

since a coroutine is garbage collected as long as they are finished and not yielding

#

right so

#

in code

#

the comptuer thingy

#

reads it line by line

#

coroutine runs instantly

#

it's like making another script inside of a script

#

or as the nerd people call it a "thread" probably i have no clue

#

no it's only like a script within a script

#

"like"

#

it's a separate thing on its own that runs

#

but yeah "script within a script" is the caveman term i use

#

yes

#

but way shitty

#

i would actually use it even if it's worse because im too lazy to type

#

except for the fact that it clogs

#

they talked about 30Hz pipeline something something, not guaranteed to continue the script

#

hence the "clogging"

#

no

#

linearvelocity

#

has different uhhhh

#

different properties

#

look inside a linearvelocity

#

wait let me find it

#

well yeah i guess it's simpler

#

there's also constraints

#

line is probably the one you're looking for

#

here is what the properties look like with line

#

you can set the line direction and the velocity

#

which i think is pretty useful

#

idk about faster but all i know is that task.wait() is more accurate

#

i also heard somewhere that wait() itself is gonna get deprecated

#

but i dont know

#

probably not since it will break a few games

#

"a few" i mean like a ton

#

oh shit

#

yes you should always use that

#

also task.delay

#

stuff

#

wait

#

there's task.spawn

#

task.spawn is slightly slower than coroutine

chrome sequoia
#

task.delay opens a thread just like task.spawn, however task.delay has a “wait” parameter specifiying when it runs

warm valley
#

task.spawn is a lot better

#

coroutines probably the best idk

#

coroutines = 10 characters

#

task.spawn = also 10 characters

#

damn 🤯

#

yeah but better

chrome sequoia
#

i heard task.spawn is better than coroutines (dont take my word on it) since they handle stack traces better

warm valley
#

task library is used to schedule stuff using

#

task scheduler

#

easier to type troll

warm valley
#

all the super technical stuff is up to the mega-nerds

#

im jsut a caveman using whatever wooden club they gave me

warm valley
#

🧌

#

wrong emoji

#

and objectively, the letter "t" is always better than the letter "c"

#

no they're the same thing

#

i think

#

ignore the other stuff on there

#

balls1 is task.spawn
balls2 is coroutine.wrap

#

yeah they're virtually the same

#

yeah let me test it out

#

maybe use heartbeat instead and disconnect it when it's done

#
task.spawn(function()
    local loop;
    loop = game:GetService('RunService').Heartbeat:Connect(function()
        print('noob')
        if farted then
            loop:Disconnect()
        end
    end)
end)
#

fuck

#

im probably not the right person to ask about task.spawn and coroutines because i dont need them yet

#

How are you gonna stop the while loop

#

Oh yeah break i forgot

#

it has to be in the loop though

warm valley
#

through careful consideration i have determined that task.spawn is manlier