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
 

Re: Problems with custom destruction...

Previous Thread :: Next Thread 
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
06 Mar 2013 06:27 PM
I've made a system that damages bricks with damage tiers 1, 2, 3, 4, and 5. If above five they get deleted. The collision type damage works fine, but now that I am trying to feign an explosion, I'm having trouble. The problems start at a certain point. The rest of the script before that point isn't as related to the problem, but I am including it as well just in case...

Output: Workspace.EvilSnowflake.IceSplosion:78: bad argument #2 to '?' (Vector3 expected, got nil)

Script:

teir1 = "http://www.roblox.com/asset/?id=12251538"
teir2 = "http://www.roblox.com/asset/?id=18767969"
teir3 = "http://www.roblox.com/asset/?id=29268434"
teir4 = "http://www.roblox.com/asset/?id=30217423"
teir5 = "http://www.roblox.com/asset/?id=16251577"

local center = script.Parent

local debris = game:GetService("Debris")

local tiny = game.Lighting.TinySnowflake:Clone()

local exploded = false


function Icesplosion(hit)
if exploded == false then
exploded = true
local sign = 1
local missiles = {}

local initDirection = center.CFrame.lookVector

for i = 1, 40 do
local direction
local num = i%30
if num == 0 then
direction = center.CFrame.lookVector
else
direction = CFrame.Angles(0, (num-1) * sign * math.pi/20, 0) * center.CFrame.lookVector
end
local spawnPos = (center.Position - Vector3.new(0, 2, 0)) + direction * 4.0
sign = sign * -1

missiles[i] = tiny:Clone()
missiles[i].CFrame = (CFrame.new(spawnPos, spawnPos + direction))
missiles[i].Velocity = direction * 200.0
missiles[i].RotVelocity = Vector3.new(0, 10, 0)
missiles[i].CFrame = missiles[i].CFrame + Vector3.new(0,math.random(-20,20),0)

local floatForce = Instance.new("BodyForce")
floatForce.force = Vector3.new(0, missiles[i]:GetMass() * 196.1, 0)
floatForce.Parent = missiles[i]

missiles[i].Parent = game.Workspace

debris:AddItem(missiles[i], 5)
end
end

ARG = math.random(1,4)
if ARG == 1 then
script.Parent.Ice1:Play()
elseif ARG == 2 then
script.Parent.Ice3:Play()
elseif ARG == 3 then
script.Parent.Ice3:Play()
elseif ARG == 4 then
script.Parent.Ice4:Play()
end

wait(0.1)

e = game.Lighting.Icesplosion1:Clone()
e2 = game.Lighting.Icesplosion2:Clone()
e.CFrame = center.CFrame
e2.CFrame = center.CFrame
--e.BP.position = center.Position - Vector3.new(0,10,0)
--e2.BP.position = center.Position - Vector3.new(0,10,0)
e.Parent = workspace
e2.Parent = workspace
debris:AddItem(e, 2)
debris:AddItem(e2, 2)

-- Problems start here ----------------------------

function getDis(a,b)
return (a-b).magnitude
end


local fakeExplosionPosition = script.Parent.Position
local Radius = 25



for i, v in pairs(Workspace.Castle:GetChildren()) do

local hum = v.Parent:FindFirstChild("Humanoid")
local zum = v.Parent:FindFirstChild("Zombie")
local hurt = v:FindFirstChild("damage")
local im_on_your_team_idiot = hit:FindFirstChild("hazard")


if --[[not hurt and]] v.Anchored == false and getDis(--[[hurt.Parent.Position]]v.Position, fakeExplosionPositon) <= Radius then

if hum == nil and zum == nil and im_on_your_team_idiot == nil and hurt == nil then

hurty = Instance.new("NumberValue")
hurty.Name = "damage"
hurty.Parent = hit
hurt = hurty

end
end

if hurt and getDis(hurt.Parent.Position, fakeExplosionPositon) <= Radius and hurt.Value == 0 then

tex = Instance.new("Texture")
tex.Texture = teir1
tex.Parent = v
tex.Face = "Back"
tex2 = tex:Clone()
tex2.Parent = v
tex2.Face = "Bottom"
tex3 = tex2:Clone()
tex3.Parent = v
tex3.Face = "Front"
tex4 = tex3:Clone()
tex4.Parent = v
tex4.Face = "Left"
tex5 = tex4:Clone()
tex5.Parent = v
tex5.Face = "Right"
tex6 = tex5:Clone()
tex6.Parent = v
tex6.Face = "Top"

hurt.Value = hurt.Value + 1

end
--the other damage teir checks would go here
end

script.Parent:Remove()
end

script.Parent.Touched:connect(Icesplosion)






Please be kind enough to help.
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
06 Mar 2013 06:39 PM
You repeated your variable incorrectly on line 78.

fakeExplosionPosition ~= fakeExplosionPositon <-- 'tion' not 'ton'!

Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
06 Mar 2013 06:44 PM
Thanks for pointing that out, but I'm getting the same error still.
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
06 Mar 2013 08:32 PM
Bump.
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
06 Mar 2013 09:33 PM
Bump again :/
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
06 Mar 2013 09:39 PM
I'm pretty sure you've posted this twice.
If nobody is helping, please do not bump every hour or so.
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
06 Mar 2013 10:19 PM
Before I didn't know how to do it, someone gave me a method of doing it. Now I have that method, but I messed up and need help with that now.
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
07 Mar 2013 09:24 AM
Bump -_-
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
07 Mar 2013 05:28 PM
Arrrg bump...
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
07 Mar 2013 07:05 PM
Bump... again....
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
07 Mar 2013 07:11 PM
lol, looks like no one knows what your problem is, i would assume you know what ROBLOX Studio does to show errors? sometimes its a red squiggly line, other times, it shows the line that the error is on in the Output
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
07 Mar 2013 07:38 PM
I put my error up on my post...
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
07 Mar 2013 08:20 PM
Bump T_T
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
07 Mar 2013 08:22 PM
Dude, nobody knows.
Stop bumping.
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
07 Mar 2013 08:31 PM
Then how in the world am I going to get help?
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
07 Mar 2013 09:53 PM
Builderman? luahelpers? idk, ask some pro... ask stickmasterluke, or d4rk886
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
26 Jul 2013 02:22 PM
Since I decided to come back to ROBLOX, I might as well bump this so I can work on my place again.
Report Abuse
MrLisawsome is not online. MrLisawsome
Joined: 18 Jan 2010
Total Posts: 3606
26 Jul 2013 02:58 PM
Wow. I just fixed it myself.
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