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 » Scripters
Home Search
 

Re: How can I make A player slowly fade

Previous Thread :: Next Thread 
exoSentinel is not online. exoSentinel
Joined: 18 Mar 2012
Total Posts: 2795
16 Apr 2016 09:59 PM
I know how to make it but there's a lot of repetition and I'm not sure how to do it efficiently.


Report Abuse
exoSentinel is not online. exoSentinel
Joined: 18 Mar 2012
Total Posts: 2795
16 Apr 2016 10:00 PM
Bump


Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
16 Apr 2016 10:03 PM
You mean like their characters?
I would use a for loop.

For instance, this will make the part's transparency quickly go from 0 to 1:

local p = part

for i=1, 10 do
p.Transparency = p.Transparency - 1
end

u sicko!
Report Abuse
exoSentinel is not online. exoSentinel
Joined: 18 Mar 2012
Total Posts: 2795
16 Apr 2016 10:11 PM
Well, I can't change the transparency of the character as a whole, but what's an efficient way I can do it to each part?


Report Abuse
exoSentinel is not online. exoSentinel
Joined: 18 Mar 2012
Total Posts: 2795
16 Apr 2016 10:14 PM
BOOMP


Report Abuse
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
16 Apr 2016 10:15 PM
-- put the code below in a local script. your character's torso should fade away when they touch the part. You can add in more code yourself to make the characters arms, legs, head etc... face away. --


local player = game.Player.LocalPlayer
local part = game.Workspace.Part -- lets assume you have a part in workspace called "part"

part.Touched:connect(function()
repeat
player.Character.Torso.Transparency = player.Character.Torso.Transparency + 1
wait(.1)
until
player.Character.Torso.Transparency ===1
end
end)
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
16 Apr 2016 10:16 PM
Also for loops :)
This time, you would use it to iterate through all of the parts inside of the character.

local character = game.Workspace.Character

for i,v in pairs(character:GetChildren()) do
if v:IsA("BasePart") then
fori=1, 10 do
v.Transparency - v.Transparency -.1
end
end
end

u sicko!
Report Abuse
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
16 Apr 2016 10:16 PM
i meant to do == 1 srry
Report Abuse
exoSentinel is not online. exoSentinel
Joined: 18 Mar 2012
Total Posts: 2795
16 Apr 2016 10:16 PM
It must be in a regular script, basically when I hit a door I want an efficient way to slowly fade myself. I know how to make the loop.


Report Abuse
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
16 Apr 2016 10:17 PM
@exo, use klink's code, his is more efficient.
Report Abuse
Dr_Doge is not online. Dr_Doge
Joined: 07 Dec 2011
Total Posts: 645
16 Apr 2016 10:17 PM
function Fade(obj)
a=0
repeat
local children = obj:GetChildren()
for i = 1, #children do
if children[i].ClassName=='Part' then
children[i].Transparency=a
a=a+0.1
end
until a==1
end
end

Fade(game.Players.LocalPlayer.Character)

--That should work.
Report Abuse
exoSentinel is not online. exoSentinel
Joined: 18 Mar 2012
Total Posts: 2795
16 Apr 2016 10:17 PM
Thanks Dr.


Report Abuse
Dr_Doge is not online. Dr_Doge
Joined: 07 Dec 2011
Total Posts: 645
16 Apr 2016 10:20 PM
Np
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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