I want to make arrows and bows fly in multiplayer games

I made it like a video tutorial (tutorial) without using a plugin. It doesn’t work.

I don’t know what the reason is…

Help…

Error message: Arrow is not a valid member of Tool “Workspace.PlayerName.Bows”

※ I used Google Translate.

Using plugins : youtube : Roblox Studio Bow & Arrow Tutorial - YouTube
No plugins : youtube : How to Make a BOW | HowToRoblox - YouTube

– server script

– Settings –

local Damage = 30
local Cooldown = 0.5
local ChargeTime = 1
local ArrowVelocity = 150
local MinChargeTime = 0.25
local HoldingAnimationId = “http://www.roblox.com/asset/?id=8446158851
– you’ll have to change these animation ids
local ChargingAnimationId = “http://www.roblox.com/asset/?id=8446454852
local ChargedAnimationId = “http://www.roblox.com/asset/?id=8446482502
local FireAnimationId = “http://www.roblox.com/asset/?id=8446502515
local ArrowLifeTime = 30

– Variables –

local RemoteEvent = script.Parent:WaitForChild(“Update”)
local LastFire = tick()
local ChargeStart = tick()

– Script –

RemoteEvent.OnServerEvent:Connect(function(plr, Type, LookVector, RightVector)

local Tool = script.Parent
local Player = plr – Tool.Parent.Parent
local Character = workspace:WaitForChild(Player.Name)
local Humanoid = Character:FindFirstChildOfClass(“Humanoid”)
local IsCharging = false
local Arrow = game.ReplicatedStorage.Arrow
– Animations –

local Anim1 = Instance.new(“Animation”)
Anim1.AnimationId = HoldingAnimationId
local HoldingAnimation = Humanoid:LoadAnimation(Anim1)

local Anim2 = Instance.new(“Animation”)
Anim2.AnimationId = ChargingAnimationId
local ChargingAnimation = Humanoid:LoadAnimation(Anim2)

local Anim3 = Instance.new(“Animation”)
Anim3.AnimationId = ChargedAnimationId
local ChargedAnimation = Humanoid:LoadAnimation(Anim3)

local Anim4 = Instance.new(“Animation”)
Anim4.AnimationId = FireAnimationId
local FireAnimation = Humanoid:LoadAnimation(Anim4)

if Type == “Activated” then
if tick()-LastFire > Cooldown then
ChargeStart = tick()
IsCharging = true
script.Parent.Arrow.Transparency = 0
ChargingAnimation:Play()
wait(ChargingAnimation.Length)
ChargedAnimation:Play()
end
elseif Type == “Deactivated” then
ChargedAnimation:Stop()
script.Parent.Arrow.Transparency = 1
if tick()-ChargeStart > MinChargeTime then
FireAnimation:Play()
LastFire = tick()
– Fire an Arrow
local A = Arrow:Clone()
A.Parent = workspace
A.CFrame = script.Parent.Arrow.CFrame
A.Sender.Value = Character

local Ignore = {Character}
for i, Part in pairs(workspace:GetDescendants()) do
if Part:IsA(“BasePart”) then
if not Part.CanCollide then
table.insert(Ignore, Part)
end
end
end
local params = RaycastParams.new()
params.FilterDescendantsInstances = Ignore
params.FilterType = Enum.RaycastFilterType.Blacklist

local results = workspace:Raycast(Character.HumanoidRootPart.Position, Character.HumanoidRootPart.Position+LookVector*10, params)

if not results then
A.Position = A.Position+RightVector*2.5
end

– Calculate the Velocity and Damage

if tick()-ChargeStart < ChargeTime then
A:ApplyImpulse(LookVector*(tick()-ChargeStart)ArrowVelocity)
A.Damage.Value = Damage
(tick()-ChargeStart)
else
A.Damage.Value = Damage
A:ApplyImpulse(LookVectorChargeTimeArrowVelocity)
end
– Schedule Deletion
game.Debris:AddItem(A, ArrowLifeTime)

end
IsCharging = false
elseif Type == “Equipped” then
HoldingAnimation:Play()
elseif Type == “Unequipped” then
IsCharging = false
script.Parent.Arrow.Transparency = 1
ChargingAnimation:Stop()
ChargedAnimation:Stop()
HoldingAnimation:Stop()
end
end)

– client script

local RemoteEvent = script.Parent:WaitForChild(“Update”)
local Tool = script.Parent
local Camera = workspace.CurrentCamera

Tool.Activated:Connect(function()
RemoteEvent:FireServer(“Activated”)
end)

Tool.Deactivated:Connect(function()
RemoteEvent:FireServer(“Deactivated”, Camera.CFrame.LookVector, Camera.CFrame.RightVector)
end)

Tool.Equipped:Connect(function()
RemoteEvent:FireServer(“Equipped”)
end)

Tool.Unequipped:Connect(function()
RemoteEvent:FireServer(“Unequipped”)
end)

image

this video shows how to make projectiles, this will also make the projectile stick to the player once hit

1 Like

but if u wanna make it easier, you should use impulse
BasePart:ApplyImpulse (roblox.com)

1 Like

Does fastcast need to use external elements like plugins?

I don’t know what BasePart:ApplyImpulse(roblox.com) means.

nope,it doesn’t.

This text will be blurred

1 Like

I don’t know if the translation of the video is not good,
It seems that fastcast is downloaded from outside, not directly produced.
(It is not possible to distinguish whether the video is an introduction or a download. : Roblox how to make smooth projectiles - YouTube)

I am using a 0 to 1 production course that I can understand and fix even if there is a problem later because my level is low.

Is the fastcast simple enough to fix itself even if there is a problem?

The translation is not good, but
thank you for telling me.

The understanding of the video is low, so I changed it to Arrow,
It seems that several attempts are needed to play the Animation left in the inquiry.

Thanks for the quick and kind reply.

If you have any further questions, I’ll leave a comment.

First of all, we need to understand something of this difficult high difficulty (FastCastRedux).

I’m new to the module concept, so I think I’ll have to study this part too. :slight_smile:

1 Like

thank you!
I haven’t added animation yet.
As a result of translating the video you mentioned 3 times,

We have confirmed that this is a really good video, and it is producing better results than expected! Thank you very much!!!

1 Like

No problem. Enjoy you bow.

This text will be blurred

1 Like