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
 

OnRespawn Function not working?

Previous Thread :: Next Thread 
ColdUndermined is not online. ColdUndermined
Joined: 25 Jan 2010
Total Posts: 1819
27 Mar 2015 11:19 PM
Ok, so I have this onRespawn function put a GUI into the player when they enter the game and if they die/reset. When in solo it works fine. But when in Test mode or online it only works when the player spawns for the first time? Any ideas? Thanks, Cold.

function onRespawn(char)
local players = game.Players:GetPlayers()
local gameUI = script.LobbyMenu:Clone()

for i,v in pairs(players)do
gameUI.Parent = v.PlayerGui
end
end

function onEntered(player)
player.CharacterAdded:connect(function(player) onRespawn(player) end)
end

game.Players.PlayerAdded:connect(function(player) onEntered(player) end)
game.Workspace.CharacterAdded:connect(function(player) onRespawn(player) end)
Report Abuse
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
28 Mar 2015 12:17 PM
"game.Players.PlayerAdded:connect(function(player) onEntered(player) end)
game.Workspace.CharacterAdded:connect(function(player) onRespawn(player) end)"

Why do people do this? Is this like an old scripting method?

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
--stuff
end)
end)
Report Abuse
ColdUndermined is not online. ColdUndermined
Joined: 25 Jan 2010
Total Posts: 1819
28 Mar 2015 03:23 PM
Still, With that one when on Solo works perfectly fine, But when online or on "test" it only works on playerentry..
Report Abuse
ColdUndermined is not online. ColdUndermined
Joined: 25 Jan 2010
Total Posts: 1819
28 Mar 2015 04:30 PM
Bump[1]
Report Abuse
ColdUndermined is not online. ColdUndermined
Joined: 25 Jan 2010
Total Posts: 1819
28 Mar 2015 09:45 PM
Bump[2] Just a note, Filtering-Enabled is set to true in this game.
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