|
| 02 Jul 2012 03:11 PM |
Hey guys. I am in the developing of a Zombie, and it has a script called Blood, which when the Zombie dies, it perfectly makes blood without any errors. Now, I am trying to make this script where it realistically removes the blood, and in a minute removes the body. This script's parent is the Blood script which the Blood script's parent is the model, containing the parts of the Zombie, etc. Here's the Blood script, which is working:
function CreateBlood()
local Blood = Instance.new("Part") Blood.formFactor = "Plate" Blood.Size = Vector3.new(1,0.4,1) Blood.Name = "Blood" Blood.Reflectance = 0.2 Blood.Transparency = 0.2 Blood.BrickColor = BrickColor.new("Bright green") Blood.Locked = true Blood.BackSurface = "Glue" Blood.BottomSurface = "Glue" Blood.FrontSurface = "Glue" Blood.LeftSurface = "Glue" Blood.RightSurface = "Glue" Blood.TopSurface = "Glue"
local CC = math.random(1,2)
if CC == 1 then
Blood.CanCollide = true
elseif CC == 2 then
Blood.CanCollide = false
end
Blood.Position = script.Parent.Torso.Position Blood.Parent = script.Parent
end
zombie = script.Parent.Zombie lhh = zombie.Health
while true do
if zombie.Health < lhh then
howmuch = math.random(7,20) lhh = zombie.Health
for i = 1 , howmuch do
CreateBlood()
end
end
wait(0.1)
end
Now here is the script that is supposed to realistically remove the blood, and eventually the body, but doesn't work:
repeat wait(0.01) until script.Parent:FindFirstChild("Blood")
if Blood then
wait(5)
Blood.Transparency = 0.3 wait(0.1) Blood.Transparency = 0.4 wait(0.1) Blood.Transparency = 0.5 wait(0.1) Blood.Transparency = 0.6 wait(0.1) Blood.Transparency = 0.7 wait(0.1) Blood.Transparency = 0.8 wait(0.1) Blood.Transparency = 0.9 wait(0.1) Blood.Transparency = 1
wait(0.01)
Blood:Remove()
wait(60)
for _, Part in pairs(Part.Parent:children()) do if Part:IsA("Part") then
Part.Transparency = 0.1 wait(0.1) Part.Transparency = 0.2 wait(0.1) Part.Transparency = 0.3 wait(0.1) Part.Transparency = 0.4 wait(0.1) Part.Transparency = 0.5 wait(0.1) Part.Transparency = 0.6 wait(0.1) Part.Transparency = 0.7 wait(0.1) Part.Transparency = 0.8 wait(0.1) Part.Transparency = 0.9 wait(0.1) Part.Transparency = 1 wait(0.01) script.Parent.Parent:Remove()
end
Here is the output:
Workspace.Zombie.Blood.Clean:54: 'end' expected (to close 'for' at line 29) near eof |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2012 03:14 PM |
| Oh, and uhm, by the way, the script that cleans the blood and body realistically is called Clean. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2012 03:23 PM |
or _, Part in pairs(Part.Parent:children()) do if Part:IsA("Part") then
Part.Transparency = 0.1 wait(0.1) Part.Transparency = 0.2 wait(0.1) Part.Transparency = 0.3 wait(0.1) Part.Transparency = 0.4 wait(0.1) Part.Transparency = 0.5 wait(0.1) Part.Transparency = 0.6 wait(0.1) Part.Transparency = 0.7 wait(0.1) Part.Transparency = 0.8 wait(0.1) Part.Transparency = 0.9 wait(0.1) Part.Transparency = 1 wait(0.01) script.Parent.Parent:Remove()
end -- if
U have no end -- for
|
|
|
| Report Abuse |
|
|
|
| 02 Jul 2012 03:31 PM |
| ? Can you post the corrected ver.? |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2012 03:39 PM |
YOU FORGOT AN END TO CLOSE "for"
If You made this, then what We're saying should be easy for You understand. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2012 03:47 PM |
| Well, the truth is, I haven't played ROBLOX in almost a year. I think I know what you mean though. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2012 03:49 PM |
Do you mean:
for _, Part in pairs(Part.Parent:children()) do if Part:IsA("Part") then
end
Part.Transparency = 0.1 wait(0.1) Part.Transparency = 0.2 wait(0.1) Part.Transparency = 0.3 wait(0.1) Part.Transparency = 0.4 wait(0.1) Part.Transparency = 0.5 wait(0.1) Part.Transparency = 0.6 wait(0.1) Part.Transparency = 0.7 wait(0.1) Part.Transparency = 0.8 wait(0.1) Part.Transparency = 0.9 wait(0.1) Part.Transparency = 1 wait(0.01) script.Parent.Parent:Remove() |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2012 03:50 PM |
| I apologies I haven't played ROBLOX in a while. |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jul 2012 03:59 PM |
| I have to go somewhere, I'll be back shortly. It would be nice if I could get some answers, I haven't been on ROBLOX for almost a year until now, so my knowledge of scripting has decreased. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 02 Jul 2012 05:27 PM |
| Just add an end after the end you already have at the bottom |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 02 Jul 2012 05:30 PM |
| i meant whiterain but mr, desperate times calls for desperate measures |
|
|
| Report Abuse |
|
|