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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
Soccerboy19 is not online. Soccerboy19
Joined: 06 Jun 2008
Total Posts: 1394
14 Jan 2012 01:59 AM
[ Content Deleted ]
Report Abuse
Soccerboy19 is not online. Soccerboy19
Joined: 06 Jun 2008
Total Posts: 1394
14 Jan 2012 02:05 AM
[ Content Deleted ]
Report Abuse
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
14 Jan 2012 02:12 AM
-.- you need help with something ?

*points to the Forum name*!
Report Abuse
Soccerboy19 is not online. Soccerboy19
Joined: 06 Jun 2008
Total Posts: 1394
14 Jan 2012 02:15 AM
[ Content Deleted ]
Report Abuse
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
14 Jan 2012 02:16 AM
ok thx for the information
Report Abuse
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
14 Jan 2012 02:17 AM
but just keep in mind best should know what Scripting Helpers forum is for before posting in there :P
Report Abuse
Soccerboy19 is not online. Soccerboy19
Joined: 06 Jun 2008
Total Posts: 1394
14 Jan 2012 02:29 AM
[ Content Deleted ]
Report Abuse
soccaboy17 is not online. soccaboy17
Joined: 22 Sep 2009
Total Posts: 3161
14 Jan 2012 02:33 AM
Doood sick naim man
Report Abuse
Soccerboy19 is not online. Soccerboy19
Joined: 06 Jun 2008
Total Posts: 1394
14 Jan 2012 05:18 AM
[ Content Deleted ]
Report Abuse
jinxsimpson is not online. jinxsimpson
Joined: 13 Mar 2010
Total Posts: 683
14 Jan 2012 05:25 AM
Right if you think you are good here is a pickle

Ive made a box stuck it to a plane and grouped it. I need to add a bit that says if "T" is pressed it deletes the box and droppes the tank
I have tried but i do not know how to make a connection with the vehicle you are using.I dont need anyone looking at the whole script just add a line or somethingso i can drop the tank
Here is the script:



bin=script.Parent
plane=nil
hold=false
local debounce = false
local planedebounce = false
local stuntdebounce = false
local controlling = false

function fire(pln,spn)
local missile = bin.Rocket:clone()
missile.CFrame = spn.CFrame * CFrame.new(0, 0, -35)

missile.RocketScript.Disabled = false
missile.Parent = game.Workspace

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

missile.Owner.Value = pln
end

function bomb(pln,spn)
local missile = bin.Bomb:clone()
missile.CFrame = spn.CFrame * CFrame.new(0, -10, 0)

missile.RocketScript.Disabled = false
missile.Parent = game.Workspace

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

missile.Owner.Value = pln
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

function move(target, engine)
local origincframe = engine:findFirstChild("BodyGyro").cframe
local dir = (target - engine.Position).unit
local spawnPos = engine.Position

local pos = spawnPos + (dir * 1)

engine:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000, 9000, 9000)
engine:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
wait(0.1)
engine:findFirstChild("BodyGyro").maxTorque = Vector3.new(0, 0, 0)
engine:findFirstChild("BodyGyro").cframe = origincframe
end

function findPlane(player)
local list = player.Character:GetChildren()
for x = 1, #list do
if (list[x].Name == "Plane") then
local weld = list[x]:FindFirstChild("Parts"):FindFirstChild("Seat"):FindFirstChild("SeatWeld")
if (weld ~= nil) and (weld.Part1 == player.Character:FindFirstChild("Torso")) then
return list[x]
end
end
end
return nil
end

function onButton1Down(mouse)
local vehicle = findPlane(script.Parent.Parent.Parent)
if vehicle ~= nil and debounce == false and planedebounce == false then
debounce = true

controlling = true

while true do
wait()
local engine = vehicle.Parts.Engine
local position = mouse.Hit
local target = position.p
if engine:findFirstChild("FlyScript") ~= nil then
move(target, engine)
end
if planedebounce == true or
controlling == false then break end
end
wait(.1)
debounce = false
end
end

function onButton1Up(mouse)
controlling = false
end

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

function onKeyDown(key)
if (key~=nil) then
key = key:lower()
local vehicle = findPlane(script.Parent.Parent.Parent)
if (vehicle==nil) then return end
plane = vehicle.Parts
local engine = vehicle.Parts.Engine
if (key=="f") and (bin.Reload.Value == 0) then
fire(vehicle,plane.Gun1)
fire(vehicle,plane.Gun2)
bin.Reload.Value = 1
wait(0.25)
bin.Reload.Value = 0
end
if (key=="b") and (bin.Reload.Value == 0) then
bomb(vehicle,plane.Engine)
bin.Reload.Value = 1
wait(0.5)
bin.Reload.Value = 0
end
if (key=="x") and planedebounce == false then
local power = plane.Engine:findFirstChild("FlyScript")
if (power ~= nil) then
power:remove()
end
end
if (key=="y") then
local power = plane.Engine:findFirstChild("FlyScript")
if (power ~= nil) then return end
local fly = script.FlyScript:clone()
fly.Disabled = false
fly.Parent = plane.Engine
end
if (key=="k") and planedebounce == false then
wait()
engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y -0.7, 0)
wait()
engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y -0.7, 0)
wait()
engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y -0.7, 0)
wait()
engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y -0.7, 0)
end
if (key=="h") and planedebounce == false then
wait()
engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y +0.7, 0)
wait()
engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y +0.7, 0)
wait()
engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y +0.7, 0)
wait()
engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y +0.7, 0)
return end
if (key=="j") and planedebounce == false then
local body = plane.Engine.BodyGyro
body.maxTorque = Vector3.new(9000, 9000, 9000)

local position = engine.CFrame * Vector3.new(0, 0.5, -4)
local dir = position - engine.Position

dir = computeDirection(dir)

local spawnPos = engine.Position

local pos = spawnPos + (dir * 8)

body.cframe = CFrame.new(pos, pos + dir)
wait(.2)
body.maxTorque = Vector3.new(0, 0, 0)
end
if (key=="l") and planedebounce == false then
local body = plane.Engine.BodyGyro
body.maxTorque = Vector3.new(9000, 0, 0)
local frame = plane:FindFirstChild("OriginCFrame")
if frame ~= nil then
body.cframe = frame.Value
end
wait(0.1)
body.maxTorque = Vector3.new(0, 0, 0)
end
if (key=="u") and planedebounce == false then
local body = plane.Engine.BodyGyro
body.maxTorque = Vector3.new(9000, 9000, 9000)

local position = engine.CFrame * Vector3.new(0, -0.5, -4)
local dir = position - engine.Position

dir = computeDirection(dir)

local spawnPos = engine.Position

local pos = spawnPos + (dir * 8)

body.cframe = CFrame.new(pos, pos + dir)
wait(.2)
body.maxTorque = Vector3.new(0, 0, 0)
end
if (key=="g") and planedebounce == false and stuntdebounce == false then
planedebounce = true
stuntdebounce = true
plane.Parent.Stunt.Value = 1
local body = plane.Engine.BodyGyro
body.maxTorque = Vector3.new(9000, 9000, 9000)

local currentframe = plane.Engine.CFrame

for i = 1,6 do
body.cframe = plane.Engine.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 30)
wait(.2)
end

body.cframe = currentframe
wait(.6)

body.maxTorque = Vector3.new(0, 0, 0)
planedebounce = false
plane.Parent.Stunt.Value = 0
wait(3)
stuntdebounce = false
end
if (key=="t") and planedebounce == false and stuntdebounce == false then
planedebounce = true
stuntdebounce = true
plane.Parent.Stunt.Value = 1
local body = plane.Engine.BodyGyro
body.maxTorque = Vector3.new(9000, 9000, 9000)

local currentframe = plane.Engine.CFrame
local valy = 30
local valz = 30

for i = 1,8 do
body.cframe = currentframe * CFrame.fromEulerAnglesXYZ(0, valy, valz)
valy = valy +50
valz = valz +100
wait(.1)
end

body.cframe = currentframe * CFrame.fromEulerAnglesXYZ(0, 600, 0)

wait(.5)

body.maxTorque = Vector3.new(0, 0, 0)
planedebounce = false
plane.Parent.Stunt.Value = 0
wait(4)
stuntdebounce = false
end
end
end
Report Abuse
Soccerboy19 is not online. Soccerboy19
Joined: 06 Jun 2008
Total Posts: 1394
14 Jan 2012 05:36 AM
[ Content Deleted ]
Report Abuse
jinxsimpson is not online. jinxsimpson
Joined: 13 Mar 2010
Total Posts: 683
14 Jan 2012 05:39 AM
dude i really need this
Report Abuse
Soccerboy19 is not online. Soccerboy19
Joined: 06 Jun 2008
Total Posts: 1394
14 Jan 2012 05:45 AM
[ Content Deleted ]
Report Abuse
Soccerboy19 is not online. Soccerboy19
Joined: 06 Jun 2008
Total Posts: 1394
14 Jan 2012 08:47 PM
[ Content Deleted ]
Report Abuse
Cyrok is not online. Cyrok
Joined: 11 Jan 2012
Total Posts: 630
14 Jan 2012 08:51 PM
So you admitted you were trolling, and then you continue to bump this thread? I don't mean to degrade you, but this forum is here to help debug code and explain concepts related to RBX.Lua or Lua.

{ Have a short chunk of code that isn't working? Send me a message and maybe I can assist you. }
Report Abuse
zell11 is not online. zell11
Joined: 20 Jun 2009
Total Posts: 2998
14 Jan 2012 08:55 PM
[ Content Deleted ]
Report Abuse
Soccerboy19 is not online. Soccerboy19
Joined: 06 Jun 2008
Total Posts: 1394
14 Jan 2012 09:46 PM
[ Content Deleted ]
Report Abuse
Ronster55 is not online. Ronster55
Joined: 08 Jan 2010
Total Posts: 2739
14 Jan 2012 10:20 PM
You're my idol.

~~~One day turtles will rule the world~~~
*derp face* DERP
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