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 » Game Design
Home Search
 

Re: Old Rocket Script.

Previous Thread :: Next Thread 
jackson2041 is online. jackson2041
Joined: 09 May 2009
Total Posts: 470
01 Apr 2015 01:06 PM
Hello there. I am currently trying to use an older type of rocket in a game project I am creating. It used to work perfectly, but now when I attempt to use it nothing launches. Does it look like there are any flaws in the script? I will post it below.

r = game:service("RunService")

shaft = script.Parent
position = shaft.Position

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

function blow()
swoosh:stop()
explosion = Instance.new("Explosion")
explosion.Position = shaft.Position


-- find instigator tag
local creator = script.Parent:findFirstChild("creator")
if creator ~= nil then
explosion.Hit:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
end

explosion.Parent = game.Workspace
explosion.BlastRadius = 6
explosion.BlastPressure = 5000000
connection:disconnect()
wait(.1)
shaft:remove()
end

function onPlayerBlownUp(part, distance, creator)

if part.Name == "Head" then

local humanoid = part.Parent:findFirstChild("Humanoid")
tagHumanoid(humanoid, creator)
end
end

function tagHumanoid(humanoid, creator)
-- tag does not need to expire iff all explosions lethal

if creator ~= nil then
local new_tag = creator:clone()
new_tag.Parent = humanoid

end
end

function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then

tag.Parent = nil
end
end
end

t, s = r.Stepped:wait()

swoosh = script.Parent.Swoosh
swoosh:play()

d = t + 10.0 - s
connection = shaft.Touched:connect(blow)

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

-- at max range
script.Parent.Explosion.PlayOnRemove = false
swoosh:stop()
shaft:remove()

Thank you.
Sincerely, jackson2041.
Report Abuse
jackson2041 is online. jackson2041
Joined: 09 May 2009
Total Posts: 470
01 Apr 2015 01:26 PM
Bump
Report Abuse
jackson2041 is online. jackson2041
Joined: 09 May 2009
Total Posts: 470
01 Apr 2015 02:05 PM
Bump
Report Abuse
jackson2041 is online. jackson2041
Joined: 09 May 2009
Total Posts: 470
01 Apr 2015 03:10 PM
Bump.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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