Kruss
|
  |
| Joined: 18 Dec 2008 |
| Total Posts: 240 |
|
|
| 12 Jun 2015 12:36 PM |
I'm sorry for potentially annoying the people of this forum, but I couldn't find a "scripting helpers" forum - I assume there used to be one? I honestly haven't played this game for over five years, so I am extremely rusty scripting-wise. I'm trying to fix an extremely old "tornado tool" from 2007. I have no idea what "Stack end" means anymore, but this is what the second script spits out, which results in the tool not working. You must have a blank Message in the Workspace for this tool to at least half-work. There are two scripts inside the hopperbin, the first one named Script, and the second one named tornadoScript. There is a vector3value inside the second script named "offset". If anyone could tell me how to fix this error, it would be appreciated.
A link to a copy of the tool: http://www.roblox.com/Summon-Tornado-item?id=2006998
--- Script 1 ---
-- clockwork bin=script.Parent msg = game.Workspace.Message enabled = true function onButton1Down(mouse) if not enabled then return end local player = game.Players.LocalPlayer if player == nil then return end print("trigger") -- find the best cf
enabled = false mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" if game.Workspace:findFirstChild("tornadoScript") == nil then msg.Text = "Tornado Active" newScript = bin.tornadoScript:clone() newScript.offset.Value = mouse.Hit.p newScript.Disabled = false newScript.Parent = game.Workspace wait(10) end mouse.Icon = "rbxasset://textures\\GunCursor.png" enabled = true end
function onSelected(mouse) print("Action Tool Selected") mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
bin.Selected:connect(onSelected)
--- Script 2 ---
wait(1) RADIUS = 50 TIME = 30 PIECES = 75 HEIGHT = 150 ROTATIONSPEED = 20
bodyPosition = Instance.new("BodyPosition") bodyPosition.maxForce = Vector3.new(1e+006,1e+006,1e+006) bodyPosition.position = Vector3.new(0,0,0) tag = Instance.new("IntValue") tag.Name = "radiusseed" tag2 = Instance.new("IntValue") tag2.Name = "positionseed"
removeScript = Instance.new("Script") removeScript.Source = "wait(20) game.Workspace.Message.Text = 'Tornado Inactive' script.Parent:remove()" removeScript.Parent = script
function polarToRect(r, theta) return math.cos(math.rad(theta)) * r, math.sin(math.rad(theta)) * r end
offset = script.offset.Value pieces = {} explosion = Instance.new("Part") explosion.Size = Vector3.new(1,1,1) * RADIUS explosion.Shape = 0 explosion.CanCollide = false explosion.Transparency = 1 explosion.Position = offset explosion.Touched:connect(function(part) if(part:getMass() < 1500 and #pieces <= PIECES) then table.insert(pieces, part) end end) explosion.Parent = game.Workspace wait(1) explosion:remove() print("explosion spawned") if #pieces == 0 then for i=1, PIECES do filler = Instance.new("Part") filler.Size = Vector3.new(2,1,2) filler.Parent = game.Workspace filler.Position = offset + Vector3.new(math.random(-10,10), math.random(0,10), math.random(-10,10)) table.insert(pieces, filler) end end while (#pieces < PIECES) do template = pieces[math.random(1,#pieces)] block = template:clone() block.Parent = game.Workspace block.Position = block.Position + Vector3.new(math.random(-10,10), math.random(0,10), math.random(-10,10)) table.insert(pieces, block) end while(#pieces > PIECES) do table.remove(pieces, #pieces) end
print("have ", #pieces, " pieces to fling")
for i=1,#pieces do bodyPosition:clone().Parent = pieces[i] pieces[i].Position = pieces[i].Position + Vector3.new(0,1,0) newTag = tag:clone() newTag.Value = math.random(1,10000) newTag.Parent = pieces[i] newTag = tag2:clone() newTag.Value = math.random(1,10000) newTag.Parent = pieces[i] end
print("added positions")
for i=1,100 do for j=1,#pieces do x, z = polarToRect(RADIUS * (pieces[j].radiusseed.Value / 10000 + .1), i * ROTATIONSPEED + pieces[j].positionseed.Value / 10000 * 360) pieces[j].BodyPosition.position = Vector3.new(offset.x + x, HEIGHT / 100 * i * pieces[j].radiusseed.Value / 10000, offset.z + z) end wait(TIME / 100) end print("rotated")
for i=1,#pieces do if pieces[i]:findFirstChild("BodyPosition") ~= nil then pieces[i].BodyPosition:remove() end dir = Vector3.new(pieces[i].Position.x, 0, pieces[i].Position.z) - Vector3.new(offset.x, 0, offset.z) dir = dir.unit pieces[i].Velocity = dir * math.random(100,150) end
game.Workspace.Message.Text = "Tornado Inactive" script:remove() |
|
|
| Report Abuse |
|
devMe
|
  |
| Joined: 28 Jun 2014 |
| Total Posts: 155 |
|
|
| 12 Jun 2015 12:38 PM |
We dont fix free models
Go script your own |
|
|
| Report Abuse |
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
| |
Kruss
|
  |
| Joined: 18 Dec 2008 |
| Total Posts: 240 |
|
|
| 12 Jun 2015 12:47 PM |
| i have no idea what a stack end is. |
|
|
| Report Abuse |
|
|
| 12 Jun 2015 01:16 PM |
| You would be much better making your own, or transferring it to a tool. I bet that within a few years, roblox removes hopperbins altogether |
|
|
| Report Abuse |
|
teseting
|
  |
| Joined: 15 Sep 2008 |
| Total Posts: 2535 |
|
|
| 12 Jun 2015 02:04 PM |
Roblox removed the ability to edit the source of another script around 4 years ago. You will have to add a script to the tornado script that will have
wait(20) game.Workspace.Message.Text = 'Tornado Inactive' script.Parent:Destroy()
then change this
removeScript = Instance.new("Script") removeScript.Source = "wait(20) game.Workspace.Message.Text = 'Tornado Inactive' script.Parent:remove()" removeScript.Parent = script
to
script.Script.Disabled = false
|
|
|
| Report Abuse |
|
Kruss
|
  |
| Joined: 18 Dec 2008 |
| Total Posts: 240 |
|
|
| 12 Jun 2015 02:07 PM |
| Thank you. I managed to fix it. |
|
|
| Report Abuse |
|