|
| 15 Feb 2014 08:48 PM |
This is a script to change the "map" in the place on command. Yes, this script does work. HOWEVER, when I change the map to a row of Humanoids, they all end up dead - even though their health and maxhealth are set as 100.
Script:
current_map = nil
names = {"EgoRenascitur",""}
game.Players.PlayerAdded:connect(function(player) for i, v in pairs(names) do if v == player.Name then player.Chatted:connect(function(chatmsg) if chatmsg:sub(1,1) == "-" then local map = chatmsg:sub(2, chatmsg:len()) if game.Lighting:FindFirstChild(map) then if current_map ~= nil then current_map.Parent = game.Lighting end game.Lighting[map].Parent = game.Workspace current_map = game.Workspace[map] end end end) end end end)
Any ideas to fix this? |
|
|
| Report Abuse |
|
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 15 Feb 2014 08:50 PM |
| The script isn't the problem.. the model holding the humanoid's is. |
|
|
| Report Abuse |
|
|
|
| 15 Feb 2014 08:50 PM |
@Void
Mind explaining that a bit more? I don't know what that is. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 15 Feb 2014 08:51 PM |
| ^^Ohhh yeah.. didn't think of that.. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 15 Feb 2014 08:53 PM |
| You clone it from lighting instead of just moving the parent.. then MoveTo().. then MakeJoints() on the clone, be sure to specify the parent again as well though |
|
|
| Report Abuse |
|
|
|
| 15 Feb 2014 08:53 PM |
current_map = game.Workspace[map] current_map:MakeJoints()
MakeJoints makes attachments in a model. Without these welds, humanoids would... die. Example: game.Players.LocalPlayer.Character:BreakJoints() would kill the player. |
|
|
| Report Abuse |
|
|
72Tom72
|
  |
| Joined: 15 Dec 2010 |
| Total Posts: 3919 |
|
|
| 15 Feb 2014 08:53 PM |
| (Told you this was a scripting problem.) |
|
|
| Report Abuse |
|
|
|
| 15 Feb 2014 08:55 PM |
@72
Dude, can you just not follow me around? (Ya' creep)
@Void
Thanks for the help, I'll check this out. |
|
|
| Report Abuse |
|
|
72Tom72
|
  |
| Joined: 15 Dec 2010 |
| Total Posts: 3919 |
|
|
| 15 Feb 2014 08:59 PM |
| Hey man, I like to make sure everyone is helped, at least. |
|
|
| Report Abuse |
|
|
|
| 15 Feb 2014 09:03 PM |
@72
Honestly, this wouldn't have been the first time Roblox was the reason for a script failure, not the script itself. And nobody said there was an issue last time, so I figured it had to be another Roblox problem. |
|
|
| Report Abuse |
|
|
72Tom72
|
  |
| Joined: 15 Dec 2010 |
| Total Posts: 3919 |
|
|
| 15 Feb 2014 09:05 PM |
| Based on the replies Roblox is not the reason your script failed. Your script failed because you inefficiently wrote it, hence the replies telling you to modify certain parts of code. |
|
|
| Report Abuse |
|
|
|
| 15 Feb 2014 09:11 PM |
@72
If you're not going to be helpful, don't continue to post replies. It's unnecessary for either of us to waste time.
I know in 'this' example it was a piece of the script, but there are actually times where it 'is' Roblox's fault. For Example: Did you know that you're unable to get your head's and "HumanoidRootPart"'s CanCollide to equal false? The Roblox game will allow you to do it, but almost (if not) immediately change it back to CanCollide = true. |
|
|
| Report Abuse |
|
|
72Tom72
|
  |
| Joined: 15 Dec 2010 |
| Total Posts: 3919 |
|
|
| 15 Feb 2014 09:13 PM |
| That's still not a studio problem but I was always speaking in the context of this line of code. Trust me, look at my game. I know how to script from scratch and I know what's a user problem and what's not. |
|
|
| Report Abuse |
|
|
|
| 15 Feb 2014 09:17 PM |
@72
Ok, we're seriously wasting time fighting. I made a mistake, my fault - I'm not one to make up some story to back myself up. I know I messed up.
Now, no hard feelings? |
|
|
| Report Abuse |
|
|