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)```
#How Do I make a Boomerang?
202 messages · Page 1 of 1 (latest)
this is old code btw
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
okay so
use a remote function to get the mouse look vector and return the mouse location
** You are now Level 3! **
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
but still use remote function right?
actually subtract it
forget about ur current script
where do I put the remote function
ik
deleted everything that I didn't understand
inside replicated storage
done
then say this:? local RemoteFunction = game.ReplicatedStorage:WaitForChild("RemoteFunction")
before I help u even further do u know about look vector and math.rad or math.asin
local RemoteFunction = game.ReplicatedStorage:WaitForChild("RemoteFunction")
I know math.rad
turns angles into radians
do u know how velocity works
okay good
what about this and raycasting
idk how raycasting works
if u dont understand that u need to read the documentation
never used it for anything
read a documentation about raycasting or u wont understand anything ill say
also if u know about velocity that would be great
so it's a laser used to detect if something in it's way exists or not?
yes kind of
its like a laser yeah
it check whats there
ok does that count?
yes
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
ill tell u
simple inverse whatever you did to make it go far
sure but it wont be a good transition
maybe use lerp then
hmmm i dont know if that will help with the transition
let's use ur first method cuz it might not turnout that bad
ok
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
so something like this?
player = game.players.LocalPlayer
Mouse = player:getMouse()
local function BoomerangFly()
Mouse.CFrame.LookVector - Boomerang.Handle.Position * 100
yeah but dont for get to save the distance in a variable
so u can use it later
local distance = (Mouse.CFrame.LookVector - Boomerang.Handle.Position * 100).Magnitude
and get the magnitude
Mouse.CFrame.LookVector - Boomerang.Handle.Position * 100 this is distance?
as well
ah ok
yes but get the magnitude
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
it's aight
you can go
ok
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
seems like we're not doing anything with the remote function
u do need it
u need it to get the mouse position u cant do everything on a local script
ill back soon
@grave harness where's bro
sorry im back now
aight how do we do this thing!
so far you told me how to calculate the distance but that's it
theres more
like?
** You are now Level 11! **
and why do we need that
because u cant make the entire boomer in a local script or it wont work lol
why
if u dont know why then u have a alot to learn before making this boomerang
yeah just tell me
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
ohh right because a local script only shows if THAT specific player did the thing you're telling him to and everyone else won't see it
learn about remote events and functions
I know remote events are used to communicate between different types of scripts but that's it
ok
u need to learn more about them before we continue
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
yeah we already got that
and that's gonna need a normal script?
yes
learn about remote functions and remote events so u can understand everything
i want u to learn something from this
then why did we calculate the distance in the local script then?
not in the local script
?
sorry im back
u can put it in the tool
it does not need to be in server script service
server script service is for like big stuff
yeah
no such thing lol
?
yes
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```
not like that
** You are now Level 5! **
ill send u a video u can understand it better
I Made A Roblox Game in 10 Minutes..
Hey guys! Welcome back to a brand new roblox studio development related video. In today's video I was challenged to make an entire roblox game in 10 minutes.. and I did just that. It was pretty fun not gonna lie. Let me know if you guys wanna see a 1 hour challenge or a making a game in 24 hour challenge. I ...
@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
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...
u cant make ur tool a model
thought we don't need that?
bro just tell me the stuff I need
it will teach u about remote events
no need for this extra stuff
ok
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
yeah but our handle is
ok
ok user?
ok accept
no I am 16
ok
i believe u its ok i was just asking
but we can vc in the future
did u invite me
did you accept first?
names combinationto on roblox
accept my request
it's required
workspace
can u make a baseplate
ok
its ok forget about the baseplate
how
ok
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?
yeah