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 » Scripting Helpers
Home Search
 

Re: Humanoids Randomly Dieing On Me?

Previous Thread :: Next Thread 
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
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
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
15 Feb 2014 08:49 PM
:MakeJoints() on the map.
Report Abuse
Goulstem is not online. 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
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
15 Feb 2014 08:50 PM
@Void

Mind explaining that a bit more? I don't know what that is.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
15 Feb 2014 08:51 PM
^^Ohhh yeah.. didn't think of that..
Report Abuse
Goulstem is not online. 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
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
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 is not online. 72Tom72
Joined: 15 Dec 2010
Total Posts: 3919
15 Feb 2014 08:53 PM
(Told you this was a scripting problem.)
Report Abuse
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
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 is not online. 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
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
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 is not online. 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
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
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 is not online. 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
EgoRenascitur is not online. EgoRenascitur
Joined: 17 Nov 2013
Total Posts: 1049
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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