#How Do I make a Boomerang?

202 messages · Page 1 of 1 (latest)

ocean vortex
#
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local Boomerang = game.StarterPack:WaitForChild("Boomerang")
local BoomerangAnim = player.Backpack:WaitForChild("Boomerang") 
local ThrowAnim = game.StarterPlayer.StarterCharacterScripts:WaitForChild("Throw")
local ThrowAnimTrack = humanoid:LoadAnimation(ThrowAnim)
BoomerangAnim.Equipped:Connect(function()
    ThrowAnimTrack:Play()
    BoomerangAnim:PivotTo(BoomerangAnim.PrimaryPart.CFrame * 5)
    
end)```
ocean vortex
#
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local Boomerang = game.StarterPack:WaitForChild("Boomerang") -- Assuming Boomerang is in the player's backpack
local BoomerangAnim = player.Backpack:WaitForChild("Boomerang")
local ThrowAnim = game.StarterPlayer.StarterCharacterScripts:WaitForChild("Throw")
local ThrowAnimTrack = humanoid:LoadAnimation(ThrowAnim)

local function CreateBoomerang()
    local Boomerang = Boomerang:Clone()
    Boomerang.Parent = player.Backpack
    return Boomerang
end

local function CircularMotion()
    if not Boomerang or not Boomerang:IsA("Tool") then
        return
    end

    local BoomerangHandle = Boomerang:WaitForChild("Handle") -- Adjust this based on the actual handle name

    local circularMotion = Instance.new("BodyAngularVelocity")
    circularMotion.MaxTorque = Vector3.new(0, math.huge, 0)
    circularMotion.AngularVelocity = Vector3.new(0, 5, 0) -- Adjust the angular velocity for the desired speed

    local bodyPosition = Instance.new("BodyPosition")
    bodyPosition.MaxForce = Vector3.new(0, math.huge, 0)
    bodyPosition.Position = BoomerangHandle.Position + Vector3.new(0, 5, 0) -- Adjust the height of the circular path

    circularMotion.Parent = BoomerangHandle
    bodyPosition.Parent = BoomerangHandle

    wait(5) -- Adjust the duration of the circular motion

    circularMotion:Destroy()
    bodyPosition:Destroy()
end

local function FlyBoomerang()
    local Boomerang = CreateBoomerang()
    ThrowAnimTrack:Play()
    wait(0.1)  -- wait for the animation to start
    CircularMotion(Boomerang)
end

BoomerangAnim.Equipped:Connect(function()
    ThrowAnimTrack:Play()
    CircularMotion()
end)
player.Backpack.ChildAdded:Connect(function(item)
    if item:IsA("Tool") and item.Name == "Boomerang" then
        item.Activated:Connect(FlyBoomerang)
    end
end)```
#

current code

grave harness
#

okay so

#

use a remote function to get the mouse look vector and return the mouse location

dire coyoteBOT
#

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

grave harness
#

then make a server script

#

and subtract the mouse look vector and the boomerangs handles position and multiply it big around 100 or more so u can get the distance and if u want the magnitude just use .magnitude

#

ur going to use velocity

ocean vortex
#

but still use remote function right?

grave harness
#

actually subtract it

grave harness
ocean vortex
#

where do I put the remote function

ocean vortex
#

deleted everything that I didn't understand

grave harness
ocean vortex
#

done

#

then say this:? local RemoteFunction = game.ReplicatedStorage:WaitForChild("RemoteFunction")

grave harness
ocean vortex
#

local RemoteFunction = game.ReplicatedStorage:WaitForChild("RemoteFunction")

ocean vortex
#

turns angles into radians

grave harness
grave harness
grave harness
ocean vortex
#

idk how raycasting works

grave harness
#

if u dont understand that u need to read the documentation

ocean vortex
#

never used it for anything

grave harness
#

also if u know about velocity that would be great

ocean vortex
grave harness
#

its like a laser yeah

#

it check whats there

ocean vortex
#

ok does that count?

grave harness
#

yes

ocean vortex
#

alright cool

#

why do we need said laser ?

grave harness
#

i know how to make the boomerang go far and stuff but I dont know how to make the boomerang transition to the other way

#

i could but it would not look that good

grave harness
ocean vortex
grave harness
ocean vortex
grave harness
ocean vortex
#

let's use ur first method cuz it might not turnout that bad

grave harness
#

forget about raycasting for now just use velocity

#

so

#

basically

#

get the mouse look vector and subtract that from the handle position and multiply that by a big number not too big

#

because ur making a boomerang

#

then clone the boomerang and

#

then make the bomerangs velocity the mouse look vector * 200

#

then for the boomerang to come back change the velocity again

ocean vortex
grave harness
#

so u can use it later

#

local distance = (Mouse.CFrame.LookVector - Boomerang.Handle.Position * 100).Magnitude

#

and get the magnitude

ocean vortex
grave harness
#

as well

ocean vortex
#

ah ok

grave harness
#

sorry for saying this out of no where but I gatta go for a while I have to attend a family event

#

ill help u make the rest when im back

#

dont close this thread

grave harness
#

ok

ocean vortex
#
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local Boomerang = game.StarterPack:WaitForChild("Boomerang")
local BoomerangAnim = player.Backpack:WaitForChild("Boomerang")
local ThrowAnim = game.StarterPlayer.StarterCharacterScripts:WaitForChild("Throw")
local ThrowAnimTrack = humanoid:LoadAnimation(ThrowAnim)
local RemoteFunction = game.ReplicatedStorage:WaitForChild("RemoteFunction")
local Mouse = player:GetMouse()

local function BoomerangFly()
    Boomerang:Clone()
    local distance = (Mouse.CFrame.LookVector - Boomerang.Handle.CFrame.Position * 100).Magnitude
end
BoomerangAnim.Equipped:Connect(function()
    ThrowAnimTrack:Play()
end)``` current code
ocean vortex
grave harness
#

u do need it

#

u need it to get the mouse position u cant do everything on a local script

#

ill back soon

ocean vortex
#

@grave harness where's bro

grave harness
#

sorry im back now

ocean vortex
#

holy

#

you're here

grave harness
#

yes im here i was sick sorry about that

#

I had to go to the doctor but im back now

ocean vortex
#

aight how do we do this thing!

#

so far you told me how to calculate the distance but that's it

grave harness
#

theres more

ocean vortex
#

like?

dire coyoteBOT
#

studio** You are now Level 11! **studio

grave harness
#

u need the remote function to get the mouse look vector

#

and location

ocean vortex
grave harness
grave harness
# ocean vortex why

if u dont know why then u have a alot to learn before making this boomerang

grave harness
#

because the boomer rang will only be visible on ur screen

#

or it might not work at all

#

it will only be on ur client

#

also only the server can clone the boomerang and change its velocity

ocean vortex
grave harness
#

learn about remote events and functions

ocean vortex
#

?

ocean vortex
#

ok

grave harness
#

thats what roblox said

#

on their documentation

grave harness
ocean vortex
#

yeah yeah but the main thing we need is a way to make this boomerang actually move out of the player's hand and start flying

ocean vortex
grave harness
#

learn about remote functions and remote events so u can understand everything

#

i want u to learn something from this

ocean vortex
grave harness
#

not in the local script

ocean vortex
#

oh

#

where exactly

#

server storage or serverscriptservice

ocean vortex
grave harness
#

sorry im back

grave harness
#

it does not need to be in server script service

#

server script service is for like big stuff

ocean vortex
#

aight

grave harness
#

yeah

ocean vortex
#

no such thing lol

grave harness
#

?

ocean vortex
#

"server script" isn't a thing

#

right

#

so a script

grave harness
#

yes

ocean vortex
#

so something like this over there?

local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()

local function BoomerangFly()
    local distance = (Mouse.CFrame.LookVector - Boomerang.Handle.CFrame.Position * 100).Magnitude
end```
grave harness
#

not like that

dire coyoteBOT
#

studio** You are now Level 5! **studio

grave harness
#

ill send u a video u can understand it better

#

@ocean vortex I found this random video the shows u how to make a gun with velocity

#

it should help u understand it better if u dont want to read the documentation

#

its not a tutorial but u will see how he does it

ocean vortex
#

we need SetPrimaryPartCFrame since the Boomerang is a model

#

ok

grave harness
#

Advanced Roblox Scripting Tutorial #24 - Raycasting (Begainner to Pro 2019)

Hey guys, welcome back to a brand new Roblox Scripting Tutorial. In today's video I am going to be teaching about Raycasting in roblox studio. Raycasting is a very important topic especially when making things like turrets and things like that. I believed I made it as s...

▶ Play video
grave harness
ocean vortex
grave harness
#

its good for u

ocean vortex
#

bro just tell me the stuff I need

grave harness
#

it will teach u about remote events

ocean vortex
#

no need for this extra stuff

grave harness
#

ok

#

just watch the first video

#

then

ocean vortex
#

ok

grave harness
#

also i have to help 10 more people so i might not be able to help u finish making it but i will make sure u get the boomerang to atleast fly and go somewhere!

#

u can invite me in roblox studio

ocean vortex
grave harness
ocean vortex
grave harness
#

invite me to studio

ocean vortex
#

I have to be ur friend

#

gimme a sec

grave harness
#

are u under 13

#

u can invite without adding if ur above 13

ocean vortex
#

ok accept

grave harness
#

if ur under 13 then u cant be on discord

#

okay

ocean vortex
grave harness
#

ok

ocean vortex
#

we can vc if you want

#

to prove it

grave harness
#

i believe u its ok i was just asking

#

but we can vc in the future

#

did u invite me

ocean vortex
#

did you accept first?

#

names combinationto on roblox

#

accept my request

#

it's required

grave harness
#

i accepted ur friend request

#

did u invite me

ocean vortex
#

done

#

now join

grave harness
#

ok

#

where is the baseplate

ocean vortex
#

workspace

grave harness
#

can u make a baseplate

ocean vortex
#

oh right I forgot I don't got that

#

ok

grave harness
#

ok

ocean vortex
#

how do I get a new Baseplate

#

the remote function's path is wrong

grave harness
#

its ok forget about the baseplate

grave harness
ocean vortex
#

ok nvm it's right

#

I realize it now

grave harness
#

ok

ocean vortex
#

ok so you made a remote function that gets the mouse's lookvector

#

what do we use that for

#

this would be easier if we could vc

#

do you mind?

grave harness
#

yeah