cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
r = game:service("RunService")
shaft = script.Parent
position = shaft.Position
cccc = script.Parent.Explosion:clone() -- play explosion sound when projectile removed from game
sSmoke = Instance.new("Smoke")
sSmoke.RiseVelocity = 5
sSmoke.Size = .1
sSmoke.Parent = shaft
sSmoke.Color = Color3.new(0,0,0)
function fly()
direction = shaft.CFrame.lookVector
position = position + direction
error = position - shaft.Position
shaft.Velocity = 1*error
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
connection:disconnect()
wait(.1)
shaft:remove()]]
end
function onPlayerBlownUp(part, distance, creator)
if part.Name == "Head" then
local humanoid = part.Parent.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(function(t)
swoosh:stop()
cccc.Parent = Workspace
cccc:play()
explosion = Instance.new("Explosion")
explosion.Position = shaft.Position
explosion.Parent = Workspace
explosion.BlastPressure = 0
ppPart = Instance.new("Part")
ppPart.Parent = Workspace
ppPart.CFrame = shaft.CFrame
ppPart.Anchored = true
ppPart.Transparency = 1
ppPart.CanCollide = false
Smoke = Instance.new("Smoke")
Smoke.Parent = Part
Smoke.RiseVelocity = 10
Smoke.Size = 5
Smoke.Color = Color3.new(0,0,0)
Smoke.RiseVelocity = 0
Smoke.Size = 0
Smoke:remove()
ppPart:remove()
shaft:remove()
cccc:stop()
cccc:remove()
end)
while t < d do
fly()
t = r.Stepped:wait()
-- wait(.1)
-- position = shaft.Position
end
any fixes? |
|
|
Read the "Before posting code...." sticky. |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
give me the ID for this "Before posting code...." sticky! I don't see it! and I want this fixed, not a new script. AND you don't need ot halp if you don't want to and if you do not like the thread don't bump it... |
|
|
Bump it? I posted like 30 seconds after you made the thread, liar. |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
who cares, that is what I call bumping a thread. now it will be on the forums longer. and how am I not following rules by posting this? |
|
|
Not the rules, MrDoomBringer just said that a post with a ton of code and a "whats wrong with it" or similar one lined non specific tags will result in lack of replies, no rules were violated however. |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
ok,I didn't know that, I thought you said I was breaking a rule.
and, this code is almost the exact code for the rocket, shorter here:
r = game:service("RunService")
shaft = script.Parent
position = shaft.Position
cccc = script.Parent.Explosion:clone() -- play explosion sound when projectile removed from game
sSmoke = Instance.new("Smoke")
sSmoke.RiseVelocity = 5
sSmoke.Size = .1
sSmoke.Parent = shaft
sSmoke.Color = Color3.new(0,0,0)
function fly()
direction = shaft.CFrame.lookVector
position = position + direction
error = position - shaft.Position
shaft.Velocity = 1*error
end
t, s = r.Stepped:wait()
swoosh = script.Parent.Swoosh
swoosh:play()
d = t + 10.0 - s
connection =
shaft.Touched:connect(function(t)
swoosh:stop()
cccc.Parent = Workspace
cccc:play()
explosion = Instance.new("Explosion")
explosion.Position = shaft.Position
explosion.Parent = Workspace
explosion.BlastPressure = 0
ppPart = Instance.new("Part")
ppPart.Parent = Workspace
ppPart.CFrame = shaft.CFrame
ppPart.Anchored = true
ppPart.Transparency = 1
ppPart.CanCollide = false
Smoke = Instance.new("Smoke")
Smoke.Parent = Part
Smoke.RiseVelocity = 10
Smoke.Size = 5
Smoke.Color = Color3.new(0,0,0)
Smoke.RiseVelocity = 0
Smoke.Size = 0
Smoke:remove()
ppPart:remove()
shaft:remove()
cccc:stop()
cccc:remove()
end)
while t < d do
fly()
t = r.Stepped:wait()
end
------------------------------------------
the lowest I can go without breaking it... |
|
gaius19Join Date: 2009-08-03 Post Count: 3159 |
Have you seen your name under 'Started By'? It's CYRUS1222...
I'll see what's wrong with it in a second... |
|
gaius19Join Date: 2009-08-03 Post Count: 3159 |
Does it, by any chance, happen to fall when you insert the Smoke into it? |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
nope. It's in there from when it appears. |
|
gaius19Join Date: 2009-08-03 Post Count: 3159 |
Have you tested it without the Smoke? You can just not set it's parent btw...
I'm wondering since I heard about a possible glitch, and I have yet to verify it... |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
what glitch?
I could help. |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
I also have it controlable by script...
could that be the problem?
smoke did nothing. |
|
gaius19Join Date: 2009-08-03 Post Count: 3159 |
Nevermind... I don't think it works...
It was something about how Inserting Smoke into a Part interfered with the Physics Objects... |
|
gaius19Join Date: 2009-08-03 Post Count: 3159 |
Actually, do you ever see the Smoke get inserted with the Script you last posted? Because you have
Smoke.Parent = Part
And I don't see where you declare Part... |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
was what I said possibly doing anything? |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
??? |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
I'm using with no smoke right now. |
|
gaius19Join Date: 2009-08-03 Post Count: 3159 |
No, I said the Smoke probably doesn't mess with the Physics Objects... Must be something else... |
|
gaius19Join Date: 2009-08-03 Post Count: 3159 |
I can only think of 2 problems with your script... |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
is CFraming the bricks while they're moving possibly doing anything? |
|
gaius19Join Date: 2009-08-03 Post Count: 3159 |
No, probably not...
Though, I believe that
Smoke.Parent = Part
Should be
Smoke.Parent = ppPart |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
I KNOW! I'll fix that! That's not the problem if I'm turning that part into a "Comment" |
|
gaius19Join Date: 2009-08-03 Post Count: 3159 |
Good point, but I'm still looking for something that's actually wrong... It's not my script, so it's difficult to analyze it... Especially this late... |
|
cyrus1222Join Date: 2009-01-29 Post Count: 5141 |
it's partly mine, partly roblox's. I edited the rocket script... |
|