generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Roblox update broke Bow script anyone know how to fix it

Previous Thread :: Next Thread 
JaguarDFlame is not online. JaguarDFlame
Joined: 09 Dec 2009
Total Posts: 262
29 Jun 2014 12:14 AM
I have a lot of bow/arrow scripts in my game that are to be used for powers
anyone know how to fix them. How would I fix this?
Link to opensource game:http://www.roblox.com/One-Piece-Eternal-Hope-Renewed-place?id=129218364

Bow looks like this

bin = script.Parent
Backpack = bin.Parent
me = Backpack.Parent
Character = me.Character
torso = Character.Torso
head = Character.Head
rightarm = Character["Right Arm"]
leftarm = Character["Left Arm"]
rightleg = Character["Right Leg"]
leftleg = Character["Left Leg"]
LeftShoulder = torso["Left Shoulder"]
RightShoulder = torso["Right Shoulder"]
LeftHip = torso["Left Hip"]
RightHip = torso["Right Hip"]
Neck = torso["Neck"]
RightShoulderC0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
LeftShoulderC0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
LeftHipC0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
RightHipC0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)

function null()
Neck.C0 = NeckC0
Neck.C1 = NeckC1
RightShoulder.C0 = RightShoulderC0
RightShoulder.C1 = RightShoulderC1
LeftShoulder.C0 = LeftShoulderC0
LeftShoulder.C1 = LeftShoulderC1
RightHip.C0 = RightHipC0
RightHip.C1 = RightHipC1
LeftHip.C0 = LeftHipC0
LeftHip.C1 = LeftHipC1
end

local COOLDOWN = 3




r = game:service("RunService")


MAX_VELOCITY = 180
MIN_VELOCITY = 20

PULLBACK_TIME = 0

wait(0.1)

local Arrow = Instance.new("Part")
Arrow.Locked = true
Arrow.BackSurface = 0
Arrow.BottomSurface = 0
Arrow.FrontSurface = 0
Arrow.LeftSurface = 0
Arrow.RightSurface = 0
Arrow.Name = "Blast"
Arrow.TopSurface = 0
Arrow.formFactor = "Symmetric"
Arrow.Shape = "Block"
Arrow.Size = Vector3.new(6,6,6)
Arrow.BrickColor = BrickColor.new("Bright red")
Arrow.Transparency = 0
Arrow.Reflectance = 0.15
Arrow.Material = "Ice"
Owner = Instance.new("ObjectValue")
Owner.Parent = Arrow
Owner.Name = "Owner"
Owner.Value = me
script.ArrowScript:clone().Parent = Arrow


local force = Instance.new("BodyForce")
force.force = Vector3.new(0,313,0)
force.Parent = Arrow

function fire(target)

local head = game.Players.LocalPlayer.Character:findFirstChild("Head")
if head == nil then return end

local dir = target - head.Position
dir = computeDirection(dir)

print("DIR X:", dir.x, "Y:", dir.y, "z:", dir.z)

local missile = Arrow:clone()

local spawnPos = game.Players.LocalPlayer.Character.PrimaryPart.Position

local pos = spawnPos + (dir * 5)

missile.CFrame = CFrame.new(pos, pos + dir)

missile.ArrowScript.Disabled = false

local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = game.Players.LocalPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile

missile.Parent = game.Workspace
end

function computeDirection(vec)
local lenSquared = vec.magnitude * vec.magnitude
local invSqrt = 1 / math.sqrt(lenSquared)
return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end

enabled = true
function onButton1Down(mouse)
if not enabled then
return
end

local player = game.Players.LocalPlayer
if player == nil then return end

enabled = false
mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"


local pos = mouse.Hit.p


fire(pos, MAX_VELOCITY)


wait(COOLDOWN)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
enabled = true

end

function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

script.Parent.Selected:connect(onSelected)

Arrow looks like this:

r = game:service("RunService")


arrow = script.Parent
Owner = arrow.Owner
damage = 0.5
position = arrow.Position

function fly()
direction = arrow.CFrame.lookVector
position = position + (direction*6)
error = position - arrow.Position
arrow.Velocity = error * 50
end

function onDamage(Part)
if Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent.Name ~= Owner.Value.Name then
script.Disabled = true
if Part.Parent:FindFirstChild("Frozen") == nil then
p = Instance.new("StringValue")
p.Name = "Frozen"
p.Parent = Part.Parent
game.Debris:AddItem(p, 4)
script.Parent.Transparency = 1
x = Instance.new("Part")
x.Parent = Part.Parent.Torso
x.Shape = "Block"
x.CFrame = Part.Parent.Torso.CFrame
x.Size = Vector3.new(2,2,2)
x.TopSurface = "Smooth"
x.BottomSurface = "Smooth"
x.BrickColor = BrickColor.new("Really red")
x.Material = "Plastic"
x.Transparency = 0
x.CanCollide = false
x.Anchored = true
y = Instance.new("SpecialMesh")
y.Parent = x
y.MeshType = "Brick"
y.Scale = Vector3.new(2.5, 2.5, 2.5)
game.Debris:AddItem(x, 4)
for i = 1,100 do
Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -0.25
Part.Parent.Humanoid.Sit = true
wait(0.05)
end
end
wait(0.025)
end
end

script.Parent.Touched:connect(onDamage)

t, s = r.Stepped:wait()

d = t + 3.5 - s

while t < d do
fly()
t = r.Stepped:wait()
end

wait(1.00)

arrow:Remove()

Report Abuse
JaguarDFlame is not online. JaguarDFlame
Joined: 09 Dec 2009
Total Posts: 262
29 Jun 2014 12:37 AM
Bump
Report Abuse
Nagrath99 is not online. Nagrath99
Joined: 26 Mar 2011
Total Posts: 1537
29 Jun 2014 12:38 AM
Yes,
don't use free models



--2% mölk, best mölk
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
29 Jun 2014 12:39 AM
lold
copy/paste into localscript
Report Abuse
JaguarDFlame is not online. JaguarDFlame
Joined: 09 Dec 2009
Total Posts: 262
29 Jun 2014 12:40 AM
Its not a free model
Report Abuse
Nagrath99 is not online. Nagrath99
Joined: 26 Mar 2011
Total Posts: 1537
29 Jun 2014 12:42 AM
Don't deny something obvious.
I've seen this exact same script in Bow tools before



--2% mölk, best mölk
Report Abuse
JaguarDFlame is not online. JaguarDFlame
Joined: 09 Dec 2009
Total Posts: 262
29 Jun 2014 12:43 AM
So I just take all these Bow Scripts and copy them into local, that sounds kind of easy.. too easy
Report Abuse
JaguarDFlame is not online. JaguarDFlame
Joined: 09 Dec 2009
Total Posts: 262
29 Jun 2014 12:46 AM
Also both the bow and arrow or just the bow script I need to make local
Report Abuse
Nagrath99 is not online. Nagrath99
Joined: 26 Mar 2011
Total Posts: 1537
29 Jun 2014 12:48 AM
Should just be the bow script, not the arrow script.
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
29 Jun 2014 12:50 AM
There's nothing wrong with using free models, sure it's the users choice if they want to use it however, they can be a great resource if a player needs to reassurance of their idea. It's not the free models, it's the creator/The people updating roblox and changing the functions themselves.
Report Abuse
Nagrath99 is not online. Nagrath99
Joined: 26 Mar 2011
Total Posts: 1537
29 Jun 2014 12:51 AM
@Anony
Pointless bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image