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: [Help Calling Functions]

Previous Thread :: Next Thread 
JellyJ3eans is not online. JellyJ3eans
Joined: 10 May 2011
Total Posts: 486
18 Aug 2016 05:27 PM
So I'm trying to make a Part that's visible and cancollide, then fades and cancollide is turned to false, then the object fades into transparency

How would I call a function in the middle of this code to make a sound play when it fades in and out of visibility?




function soundz()
game.Workspace.Part.Sound:Play()
end

function soundoffz()
game.Workspace.Part.Sound:Pause()
end


while true do
game.Workspace.Part.Transparency = 0
wait(0.1)
game.Workspace.Part.Transparency = 0.1
wait(0.1)
game.Workspace.Part.Transparency = 0.2
wait(0.1)
game.Workspace.Part.Transparency = 0.3
wait(0.1)
game.Workspace.Part.Transparency = 0.4
wait(0.1)
game.Workspace.Part.Transparency = 0.5
wait(0.1)
game.Workspace.Part.Transparency = 0.6
wait(0.1)
game.Workspace.Part.Transparency = 0.7
wait(0.1)
game.Workspace.Part.Transparency = 0.8
wait(0.1)
game.Workspace.Part.Transparency = 0.9
wait(0.1)
game.Workspace.Part.Transparency = 1
game.Workspace.Part.CanCollide = false
wait(3)
game.Workspace.Part.Transparency = 0.9
wait(0.1)
game.Workspace.Part.Transparency = 0.8
wait(0.1)
game.Workspace.Part.Transparency = 0.7
wait(0.1)
game.Workspace.Part.Transparency = 0.6
wait(0.1)
game.Workspace.Part.Transparency = 0.5
wait(0.1)
game.Workspace.Part.Transparency = 0.4
wait(0.1)
game.Workspace.Part.Transparency = 0.3
wait(0.1)
game.Workspace.Part.Transparency = 0.2
wait(0.1)
game.Workspace.Part.Transparency = 0.1
wait(0.1)
game.Workspace.Part.Transparency = 0
game.Workspace.Part.CanCollide = true
wait(3)
end
Report Abuse
JellyJ3eans is not online. JellyJ3eans
Joined: 10 May 2011
Total Posts: 486
18 Aug 2016 05:28 PM
I forget how to call functions sorry
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
18 Aug 2016 05:29 PM
1.)
ew ew ew ew ew

for i=1,0,-1/30 do
transparency = i
end

2.)

function()

lol
Report Abuse
JellyJ3eans is not online. JellyJ3eans
Joined: 10 May 2011
Total Posts: 486
18 Aug 2016 05:31 PM
xD

Atleast I'm trying
Report Abuse
JellyJ3eans is not online. JellyJ3eans
Joined: 10 May 2011
Total Posts: 486
18 Aug 2016 08:17 PM
bump for blarg to respond

Hey Blarg, I didn't use your code but I figured it out in time.
Sorry for responding so late my monitor is really faulting right now,

My code will be long until I get really advanced at Lua so it's pretty depressing xD
Report Abuse
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
18 Aug 2016 08:25 PM
if you think you are writing bad code, you probably are, in that case there is most-likely a better solution.
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