#when using my attack twice the first time its normal but the 2nd time it goes 1 side then switches

210 messages · Page 1 of 1 (latest)

tacit cedar
#

ill make a video soon

#

sec

#

sorry for the quality idk why it did that

#

for thoose who didnt understnad

#

the first time im

#

shooting it

#

it goes normally

#

the 2nd time

#

it shoots first the direction u shot the first time then switches to normal

cosmic pecan
#

W H E R E

#

S C R I P T

tacit cedar
#

o sorry

#

local summon = script.Parent.summon
local throw = script.Parent.throw
ts = game:GetService("TweenService")

summon.OnServerEvent:Connect(function(player, char)
local projectile = game.Workspace.ball
local humrp = char.HumanoidRootPart

projectile.Parent = workspace
projectile.CFrame = char["Left Arm"].LeftGripAttachment.WorldCFrame - Vector3.new(0,0,10)
projectile.Anchored = false
local hollowscript = game.ServerScriptService["script for test ball"]["script for hollow purple"].Enabled == true
local tween = ts:Create(projectile, TweenInfo.new(0.25), {Transparency = 0})
tween:Play()
for i,v in pairs(projectile:GetChildren()) do
    if v:IsA("Trail") then
        v.Enabled = true
    end
end

throw.OnServerEvent:Connect(function()
    local bv = Instance.new("BodyVelocity", projectile)
    bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
    bv.Velocity = humrp.CFrame.lookVector * 250
    wait(3)
    bv.Velocity = Vector3.new(0,0,0)
    projectile.CFrame = humrp.CFrame
    local ballchildren = projectile:GetChildren()
    for i,v in pairs(ballchildren) do
        if v:IsA("BodyVelocity") then
            v:Destroy()
            projectile.Anchored = true
        end
    end
end)

end)

#

thats the first script

static jayBOT
#

studio** You are now Level 1! **studio

tacit cedar
#

local db = false

local dbtime = 1

script.Parent.Activated:Connect(function()
if db == false then
db = true

    local summon = script.Parent.summon
    local throw = script.Parent.throw
    
    local char = script.Parent.Parent
    local hum = char.Humanoid
    local anim = hum:LoadAnimation(script.Animation)
    anim:Play()
    hum.WalkSpeed = 0
    
    anim:GetMarkerReachedSignal("summon"):Connect(function()
        summon:FireServer(char)
        
    end)
    anim:GetMarkerReachedSignal("Throw"):Connect(function()
        throw:FireServer()
        end)
    wait(dbtime)
    db = false
    hum.WalkSpeed = 16
end

end)

cosmic pecan
tacit cedar
cosmic pecan
#

The actual velocity of the ball?

tacit cedar
#

like it did on the video

cosmic pecan
#

Okay

tacit cedar
#

yes

#

well destroying

#

isth

#

is the

#

uh how to say

#

is a diffrent script

cosmic pecan
#

Okay

tacit cedar
#

but it just moves the ball

#

really

#

the 2nd script does the animation

cosmic pecan
#

Put a print statement

tacit cedar
#

where

cosmic pecan
#

After the part where it

#

Says bv.Velocity = humrp.CFrame.LookVector * 250

tacit cedar
#

ok

cosmic pecan
#

So print(bv.Velocity)

#

So we can see what it prints both times

tacit cedar
#

the prints are

#

oh ops

#

i didnt stop

#

there

#

the prints ar

#

-131.0637664794922, -0, -212.89031982421875 - Server - Script:25 first
124.67882537841797, -0, -216.69146728515625

#

i also did it a third time and it did this

#

-0, -0, -250

cosmic pecan
#

Try instead using game.Workspace.Ball:Clone()

#

And then destroying the ball at the end

#

Because

#

You use the same ball each time

#

And I assume that when the new ball spawns, the bv of the old ball is carried on with it

tacit cedar
#

ok lemme see

#

so uh

#

it did work

#

but it stopped destroying

#

so theres 1 idea in my mind

#

make a copy of that script but rename the ball to ball 2

#

so it acts the same

cosmic pecan
tacit cedar
#

ok so

#

i did that

#

the first time it worked but the 2nd it didnt

#

thats because

#

uh

#

whenever

#

i use i

#

it

#

after 3 seconds

#

its programmed to

#

get destroyed

#

so i was thinking

#

after the

#

projectile:Destroy() should i add

#

script.disable?

static jayBOT
#

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

cosmic pecan
#

If so then Disable it

tacit cedar
#

its not

#

ok

#

oh it worked

#

now i have another problem i need to fix

#

can u help

cosmic pecan
#

?

#

I can try

tacit cedar
#

i need the attack to spawn infront of the player

#

ame.ServerScriptService:FindFirstChild("script for test ball")["script for blackhole"].Enabled = false

#

this line

#

oop

#

nope

#

projectile.CFrame = char["Left Arm"].LeftGripAttachment.WorldCFrame - Vector3.new(0,0,10)

#

this one

cosmic pecan
#

Left arm?

tacit cedar
#

yes

cosmic pecan
#

Hmm

tacit cedar
#

it was originally a smaller attack

#

but i decided to make it bigger

#

should i do torso?

cosmic pecan
#

Do the hrp

#

HumanoidRootPart.CFrame

#

And check where it spawns

tacit cedar
#

it spawns like before

#

btw

#

if what

#

its suppost to spawn

#

infront of the player

cosmic pecan
#

Well what do you want exactly yo happen?

tacit cedar
#

so

cosmic pecan
#

While the animation is playing

tacit cedar
#

attack spawns infront of player

#

and it goes

#

oh

#

while animation is happening

#

uh

#

wind up

#

then charge

cosmic pecan
#

So as soon as the tool is used, spawn it infront of player?

tacit cedar
#

no

#

before the

#

well

#

when the attack happened

#

i want it to spawn infront

cosmic pecan
#

Send the updated of the first script

tacit cedar
#

local summon = script.Parent.summon
local throw = script.Parent.throw
ts = game:GetService("TweenService")

summon.OnServerEvent:Connect(function(player, char)
local projectile = game.Workspace.ball:Clone()
local humrp = char.HumanoidRootPart

projectile.Parent = workspace
projectile.CFrame = humrp.CFrame - Vector3.new(0,0,10)
projectile.Anchored = false
projectile.Name = "ball2"
game.ServerScriptService:FindFirstChild("script for test ball")["script for blackhole"].Enabled = true
local tween = ts:Create(projectile, TweenInfo.new(0.25), {Transparency = 0})
tween:Play()
for i,v in pairs(projectile:GetChildren()) do
    if v:IsA("Trail") then
        v.Enabled = true
    end
end

throw.OnServerEvent:Connect(function()
    local bv = Instance.new("BodyVelocity", projectile)
    bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
    bv.Velocity = humrp.CFrame.lookVector * 250
    print(bv.Velocity)
    wait(3)
    bv.Velocity = Vector3.new(0,0,0)
    projectile.CFrame = humrp.CFrame
    local ballchildren = projectile:GetChildren()
    for i,v in pairs(ballchildren) do
        if v:IsA("BodyVelocity") then
            v:Destroy()
            projectile:Destroy()
            game.ServerScriptService:FindFirstChild("script for test ball")["script for blackhole"].Enabled = false
        end
    end
end)

end)

cosmic pecan
#

What about projectile.Position = Humrp.Position

tacit cedar
#

uh

#

wher

#

projectile.CFrame = humrp.CFrame - Vector3.new(0,0,10)

#

here?

cosmic pecan
#

Ye

tacit cedar
#

well now it kills me

static jayBOT
#

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

tacit cedar
#

it eats everything in its path

cosmic pecan
#

Try + Vector3.new(0, 0, 10)

#

And play around with the numbers

tacit cedar
#

it works but

#

the thing is

#

it works only on 1 side

#

it doesnt matter how i change the x and

#

z

cosmic pecan
#

How about projectile.Position = hump.Position * hump.CFrame.LookVector

tacit cedar
#

i think i should do cframe instead of position

cosmic pecan
#

Ye prob

tacit cedar
#

nvm it eats me

#

this is getting very complicated

#

but we will figure it out eventually

cosmic pecan
#

projectile.CFrame = humRp.CFrame

#

What does this do?

#

Try it and tell me what happens

tacit cedar
#

wait

#

i have fixed it

cosmic pecan
#

How

tacit cedar
#

i made position + vector3.new 10,0,0

#

look

#

oh i cnat record rn

#

uh

#

a new problem occoured

#

or how do u say

#

when i do it the 2nd time

#

it eats me

#

😭

cosmic pecan
#

Did u look different dir8

#

Direction *

tacit cedar
#

yes

cosmic pecan
#

Ye thats why position is bad

#

Use CFrame

tacit cedar
#

ok

cosmic pecan
#

Cuz with positions u need to look in one direction

tacit cedar
#

oh

cosmic pecan
tacit cedar
#

that will eat it

#

me*

#

because it will spawn inside of me

cosmic pecan
#

So do * humRp.CFrame.LookVectoe

#

And tell me what it does

tacit cedar
#

it gave me an error

#

Unable to assign property CFrame. CoordinateFrame expected, got Vector3

cosmic pecan
#

Try + instead of *

tacit cedar
#

it eats me

cosmic pecan
#

hmm okay one sec

#

Hi

#

Got this from ai

tacit cedar
#

hi

#

W

cosmic pecan
#

ball.Position = rootPart.Position + (rootPart.CFrame.LookVector * 5)

tacit cedar
#

thats actually a smart move

cosmic pecan
#

Lol

tacit cedar
#

yeah no it eats me

#

i fixed it

cosmic pecan
#

Change the number 5

tacit cedar
#

yeah i made it 10 studs away

#

finnaly after

cosmic pecan
#

Nice

tacit cedar
#

1 hour

#

this is fixe

#

d

cosmic pecan
#

Lol

tacit cedar
#

over 200 messages

#

😭

cosmic pecan
#

XD

tacit cedar
#

well not oevr

#

but

#

now over

#

tysm

#

ill be trying to fix

#

the fact that it eats the floor

cosmic pecan
#

Okay

tacit cedar
#

ok i fixed it

#

lol