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 » Scripters
Home Search
 

BodyVelocity Doesnt Send my Parts Flying

Previous Thread :: Next Thread 
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
27 Sep 2015 12:03 PM
local plr = game.Players.LocalPlayer
local char = plr.Character
local stats = plr:WaitForChild('Stats')
local plrm = plr:GetMouse()


local y = Instance.new("BodyVelocity")
y.maxForce = Vector3.new(math.huge, math.huge, math.huge)--Velocity Properties
y.velocity = plr.Character.Torso.CFrame.lookVector*100

local x = Instance.new("BodyVelocity")
x.maxForce = Vector3.new(math.huge, math.huge, math.huge)--Velocity Properties
x.velocity = plr.Character.Torso.CFrame.lookVector*100





--Shooting
game:GetService("UserInputService").InputBegan:connect(function(Key)
if Key.KeyCode == Enum.KeyCode.J then
blast.Parent = game.Workspace
blast.CFrame = char.Torso.CFrame + Vector3.new(6, 0, 0)
blast.Rotation = Vector3.new(0, -81.807, 0)
blast2.Parent = game.Workspace
blast2.CFrame = char.Torso.CFrame + Vector3.new(-6, 0, 0)
blast2.Rotation = Vector3.new(0, -81.807, 0)
wait(2)
game:GetService("Chat"):Chat(char.Head, "Double Barrel Blast")
y.Parent = blast
x.Parent = blast2
end
end)



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$144 Tx1,839
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
27 Sep 2015 12:05 PM
https://gyazo.com/2ff4f80de2779fe763ca54bae8c80fac

Forgot Gyazo



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$144 Tx1,839
Report Abuse
ownedyou1 is not online. ownedyou1
Joined: 03 Jul 2008
Total Posts: 528
27 Sep 2015 12:16 PM
Youre really going about this the wrong way. Why design a very long key script for shooting stuff individually when you can make a generalized function to shoot multiple things and have interchangeable skills. It makes the keydown function look a lot nicer
see below (note im not changing this to userinputservice for you)

elseif (key == "q") then
if (Open2 == false) and (Player.leaderstats.Skills.Q.Value~="None") then
Open2 = true

local jutsu = script:findFirstChild(Player.leaderstats.Skills.Q.Value)
local cd = jutsu.Cooldown.Value
wait(.1)
jutsu.HitEffects.Disabled = false

local c = jutsu:clone()
c.Parent = Character.Torso
c.Disabled = false --fires the bullet


wait(cd)
Open2 = false
end

Report Abuse
ownedyou1 is not online. ownedyou1
Joined: 03 Jul 2008
Total Posts: 528
27 Sep 2015 12:17 PM
and then my basic projectile script that it loads into the char:

local stick = script.Parent
local inc = script.Name
local char = script.Parent.Parent


function CastSpell()
--for d = 1,32 do
for i = 1,2*script.Rank.Value do
local p = Instance.new("Part")
p.formFactor = "Symmetric"
p.Shape = "Ball"
p.Size = Vector3.new(1,1,1)
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.CanCollide = true
p.Transparency = 0.5
p.BrickColor = script.SpellColor.Value
local sparx = Instance.new("Sparkles")
sparx.SparkleColor = script.SparkColor.Value
sparx.Enabled = script.HasSparkles.Value
sparx.Parent = p
local eff = script.HitEffects:clone()
eff.Parent = p
eff.Disabled = false
local bv = Instance.new("BodyVelocity")
p.Parent = char
p.Name = "MagicSpell"
p.CFrame = stick.CFrame * CFrame.new(math.random(-2,2),math.random(-2,2),-1)
bv.Parent = p
bv.velocity = script.Parent.CFrame.lookVector * 80

--end
--wait(.001)
end
end
CastSpell()
script:Remove()
Report Abuse
ownedyou1 is not online. ownedyou1
Joined: 03 Jul 2008
Total Posts: 528
27 Sep 2015 12:18 PM
note a lot of this is designed to suit my game so it might not work until you take a couple things out i didnt feel like editing xP
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
27 Sep 2015 12:33 PM
er

keydown is depricated

so it wont work online....



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$144 Tx1,839
Report Abuse
DeathsLASTwords is not online. DeathsLASTwords
Joined: 28 Jan 2012
Total Posts: 2701
27 Sep 2015 12:34 PM
@above

thats not how it works


-The box said 'Requires Windows XP or better'. So I installed LINUX...
Report Abuse
ownedyou1 is not online. ownedyou1
Joined: 03 Jul 2008
Total Posts: 528
27 Sep 2015 12:36 PM
in the beginning of my post i said im not changing this to user input data if you dont know how to script yourself then go to requests section
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
27 Sep 2015 12:39 PM
Having 2 bodyvelocity in the same instance would nullifies both effects.
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
27 Sep 2015 12:47 PM
even if theres only one body velocity it does not Fly



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$144 Tx1,839
Report Abuse
ownedyou1 is not online. ownedyou1
Joined: 03 Jul 2008
Total Posts: 528
27 Sep 2015 12:49 PM
i gave you the perfect source to use i guess ur too stupid or something
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
27 Sep 2015 12:53 PM
"too stupid"

U just gave a random ass script the first that had

the 2nd one is the exactly like mine

What kind of help did u give?



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$144 Tx1,839
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
27 Sep 2015 12:54 PM
local plr = game.Players.LocalPlayer
local char = plr.Character
local stats = plr:WaitForChild('Stats')
local plrm = plr:GetMouse()


--Shooting
game:GetService("UserInputService").InputBegan:connect(function(Key)
if Key.KeyCode == Enum.KeyCode.J then
local y = Instance.new("BodyVelocity")
y.maxForce = Vector3.new(math.huge, math.huge, math.huge)--Velocity Properties
y.velocity = plr.Character.Torso.CFrame.lookVector*100

local x = Instance.new("BodyVelocity")
x.maxForce = Vector3.new(math.huge, math.huge, math.huge)--Velocity Properties
x.velocity = plr.Character.Torso.CFrame.lookVector*100

blast.Parent = game.Workspace
blast.CFrame = char.Torso.CFrame * CFrame.new(6, 0, 0)
blast.Rotation = Vector3.new(0, -81.807, 0)
blast.Anchored = false
blast2.Anchored = false
blast2.Parent = game.Workspace
blast2.CFrame = char.Torso.CFrame * CFrame.new(-6, 0, 0)
blast2.Rotation = Vector3.new(0, -81.807, 0)
wait(2)
game:GetService("Chat"):Chat(char.Head, "Double Barrel Blast")
y.Parent = blast
x.Parent = blast2
end
end)
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
27 Sep 2015 12:56 PM
^ ty sensei

i see wut i did now

i Made the velocity Before pressing it



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$144 Tx1,839
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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