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: Why won't this work for my loading screen?

Previous Thread :: Next Thread 
JoeRaptor is not online. JoeRaptor
Joined: 08 Sep 2012
Total Posts: 282
09 Jan 2017 10:14 PM
I want to stretch the respawn time to 15 seconds but my loading screen, by which fades into view, crashes on me!Like an infinite loading loop!!! I need help! Right now!

Here is the script!

fade = script.Parent
fadeGoal = 0
fadeRate = 0.01

function updateFade()
local current = fade.BackgroundTransparency
if current < fadeGoal then
fade.BackgroundTransparency = math.min(fadeGoal,current+fadeRate)
elseif current > fadeGoal then
fade.BackgroundTransparency = math.max(fadeGoal,current-fadeRate)
else
fade.BackgroundTransparency = fadeGoal
end
end

player = game.Players.LocalPlayer
character = player.Character or player.CharacterAdded:wait()
humanoid = player.Character:WaitForChild("Humanoid")
rs = game:GetService("RunService")

fadeGoal = 1

humanoid.Died:connect(function ()
wait(1)
fadeGoal = 0
player.CharacterAdded:wait()
fadeGoal = 1
end)

rs.RenderStepped:connect(updateFade)

fade.Visible = true





[This is the respawn script from the Roblox Cookbook] <----- It does it's job but my loading screen crashes into an infinite loop.

|
|
|
V

local respawnDelay = 15

game.Players.CharacterAutoLoads = false

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
-- find the humanoid, and detect when it dies
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Died:connect(function()
wait(respawnDelay)
player:LoadCharacter()
end)
end
end)
player:LoadCharacter() -- load the character for the first time
end)
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
09 Jan 2017 10:15 PM
it crashes because it loads the character, calling the characteradded event, which in turn, loads the character again
Report Abuse
JoeRaptor is not online. JoeRaptor
Joined: 08 Sep 2012
Total Posts: 282
09 Jan 2017 10:41 PM
Nice name, I like the latin, anyway what would rid my problem so I can extend the respawn time?
Report Abuse
JoeRaptor is not online. JoeRaptor
Joined: 08 Sep 2012
Total Posts: 282
09 Jan 2017 10:49 PM
Anyone?
Report Abuse
JoeRaptor is not online. JoeRaptor
Joined: 08 Sep 2012
Total Posts: 282
09 Jan 2017 11:04 PM
Help? Please?
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