|
| 17 Jul 2014 03:27 PM |
local RespawnTime = 3 game:GetService("Players").PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) Character:WaitForChild("Humanoid").Died:wait() wait(RespawnTime) Player:LoadCharacter() print(Player.Name.." spawned.") end) Player:LoadCharacter() end)
Until recently, there was nothing wrong with this script. But for some reason, now I am getting this error:
22:22:15.010 - WaitForChild called on an Instance that is not in a DataModel. 22:22:15.011 - Script 'ServerScriptService.Service_Respawns', Line 5 22:22:15.011 - Stack End
The CharacterAdded event fires when the character is added, no? So the character should have loaded, and I should not be getting this error. I even tried adding a wait() after the CharacterAdded line. No success. If anyone knows what is wrong, please post below. Thanks.
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2014 03:57 PM |
This is kinda breaking my game, so... uh... Bump? :D
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 17 Jul 2014 04:15 PM |
I don't think you can use variables to wait.
And if you can, there needs to be "" around the 3, I believe. |
|
|
| Report Abuse |
|
|
| |
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 17 Jul 2014 04:18 PM |
@Tusc
Thanks for posting to just tell me i'm wrong instead of helping the OP. |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2014 04:20 PM |
You can use events as an argument for the wait method. Example: game:GetService("RunService").Heartbeat:wait()
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 17 Jul 2014 04:22 PM |
| Sorry, I really didn't know that. I started scripting two weeks ago, and I just tried helping. |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 07:53 AM |
2 days bump wooooo
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 07:56 AM |
diesable character auto load?
game:service'Players'.CharacterAutoLoads = false |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 07:59 AM |
@super Already done. And that doesn't have anything to do with the error.
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|