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: Script problem, zombie walking

Previous Thread :: Next Thread 
droppop is not online. droppop
Joined: 28 Aug 2009
Total Posts: 5259
16 Mar 2013 03:00 PM
function onTouch(part1)
local humanoid = part1.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
zombie1 = script.Parent.Parent.zombie1
zombie1.Head.Transparency = 0
zombie1.Torso.Transparency = 0
zombie1["Left Arm"].Transparency = 0
zombie1["Right Arm"].Transparency = 0
zombie1["Left Leg"].Transparency = 0
zombie1["Right Leg"].Transparency = 0
wait(0.3)
zombie1.Head.Transparency = 1
zombie1.Torso.Transparency = 1
zombie1["Left Arm"].Transparency = 1
zombie1["Right Arm"].Transparency = 1
zombie1["Left Leg"].Transparency = 1
zombie1["Right Leg"].Transparency = 1
wait(0.1)
local humanoid = part1.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
zombie2 = script.Parent.Parent.zombie1
zombie2.Head.Transparency = 0
zombie2.Torso.Transparency = 0
zombie2["Left Arm"].Transparency = 0
zombie2["Right Arm"].Transparency = 0
zombie2["Left Leg"].Transparency = 0
zombie2["Right Leg"].Transparency = 0
wait(0.3)
zombie2.Head.Transparency = 1
zombie2.Torso.Transparency = 1
zombie2["Left Arm"].Transparency = 1
zombie2["Right Arm"].Transparency = 1
zombie2["Left Leg"].Transparency = 1
zombie2["Right Leg"].Transparency = 1
wait(0.1)
local humanoid = part1.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
zombie3 = script.Parent.Parent.zombie1
zombie3.Head.Transparency = 0
zombie3.Torso.Transparency = 0
zombie3["Left Arm"].Transparency = 0
zombie3["Right Arm"].Transparency = 0
zombie3["Left Leg"].Transparency = 0
zombie3["Right Leg"].Transparency = 0
wait(0.3)
zombie3.Head.Transparency = 1
zombie3.Torso.Transparency = 1
zombie3["Left Arm"].Transparency = 1
zombie3["Right Arm"].Transparency = 1
zombie3["Left Leg"].Transparency = 1
zombie3["Right Leg"].Transparency = 1

end
end
end
end

script.Parent.Touched:connect(onTouch)

It's like stop-motion. One zombie becomes visible for half a sec, then the next, and then the next to make it look like the zombie's moving. However, all I get is zombie1 to flicker invisible and visible. Help!
Report Abuse
droppop is not online. droppop
Joined: 28 Aug 2009
Total Posts: 5259
16 Mar 2013 03:01 PM
They are in a model. This is what's in the model.

zombie1
zombie2
zombie3

part1

in the model.
Report Abuse
droppop is not online. droppop
Joined: 28 Aug 2009
Total Posts: 5259
16 Mar 2013 05:31 PM
D:
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
16 Mar 2013 06:31 PM
First of all lets shorten it a little:

function vis(t)
zombie1.Head.Transparency = t
zombie1.Torso.Transparency = t
zombie1["Left Arm"].Transparency = t
zombie1["Right Arm"].Transparency = t
zombie1["Left Leg"].Transparency = t
zombie1["Right Leg"].Transparency = t
end

local zombie1 = script.Parent.Parent.zombie1

function onTouch(part1)
local humanoid = part1.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
zombie1 = script.Parent.Parent.zombie1
vis(0)
wait(0.3)
vis(1)
wait(0.1)
local humanoid = part1.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
zombie2 = script.Parent.Parent.zombie1
vis(0)
wait(0.3)
vis(1)
wait(0.1)
local humanoid = part1.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
zombie3 = script.Parent.Parent.zombie1
vis(0)
wait(0.3)
vis(1)
end
end
end
end

script.Parent.Touched:connect(onTouch)
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
16 Mar 2013 06:32 PM
oops nvm me.
Report Abuse
droppop is not online. droppop
Joined: 28 Aug 2009
Total Posts: 5259
16 Mar 2013 07:12 PM
wat
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