Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Arrow script isn't working?

Asked by 9 years ago

Here is the "arrow" part of the script in my Bow. It's a local script, and I have another script inside the local script called "Damage". However, the damage does not happen when the arrow hits the player. How can I fix that?

local L=Instance.new("Part")
L.CanCollide = false
L.Name="Arrow"
L.TopSurface = "Smooth"
L.BottomSurface = "Smooth"
L.formFactor = "Symmetric"
L.Size = Vector3.new(1,1,2)
L.CFrame = CFrame.new(guy.Torso.Position+guy.Torso.CFrame.lookVector*2+V*(1.25),guy.Torso.Position+V*1500*(guy.Torso.Position-Pos).magnitude/300)*CFrame.fromEulerAnglesXYZ(math.pi,0,math.pi/2)+Vector3.new(0,0.5,0)
L.Parent = workspace
local M = script.Mesh:clone()
M.Parent = L
local Gyro = Instance.new("BodyGyro") 
Gyro.P = Gyro.P*10 
Gyro.maxTorque = Vector3.new(100000,100000,100000)*999 
Gyro.cframe = L.CFrame
Gyro.Parent = L
local force = Instance.new("BodyForce")
force.force = Vector3.new(0, 390, 0)
force.Parent = L
local S = script.Damage:clone()
local c = Instance.new("ObjectValue")
c.Name = "creator"
c.Value = player
c.Parent = S
local nv = Instance.new("StringValue")
nv.Name = "weapon"
nv.Value = Tool.Name
nv.Parent = c
1
Provide the code that damages the player please. Goulstem 8144 — 9y
0
I'm assuming you damage script goes inside the arrow part. If that's true, just set the parent of S to L. S.Parent = L; DewnOracle 115 — 9y

Answer this question