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: Okay, Next, hopefully, maybe, last question.

Previous Thread :: Next Thread 
DragonscapeRevamped is not online. DragonscapeRevamped
Joined: 27 Apr 2013
Total Posts: 36
30 Apr 2013 06:26 PM
Did I do this right?

[ I actually had no idea what to do, so I guessed o_O ]


x = ?
y = ? -- Yeah forums, I'll add in position later...
z = ?

function Death(player)
player.Torso.MoveTo.Position = Vector3.new(x,y,z)
end


script.Parent.Human.Died:connect(Death)


When the enemy dies, the killer will be teleported to the spawn.

[ Or do I need make it like this ]


function Death(player)
if player:findFirstChild("Humanoid") then
player.Torso.MoveTo.Position = Vector3.new(x,y,z)

end
end


script.Parent.Human.Died:connect(Death)





Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
30 Apr 2013 06:27 PM
player.Torso.MoveTo.Position = Vector3.new(x,y,z)

should be
player.Torso.Position = Vector3.new(x,y,z)--assuming player is defined as the character

Also:

script.Parent.Humanoid.Died--unless you named the Humanoid Human o-o
Report Abuse
DragonscapeRevamped is not online. DragonscapeRevamped
Joined: 27 Apr 2013
Total Posts: 36
30 Apr 2013 06:29 PM
I did name the HUmanoid Human, it's for an RPG boss, you kill it, sends you to spawn.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
30 Apr 2013 06:29 PM
Wait, I don't even think the Died event gives an argument o-o

Report Abuse
DragonscapeRevamped is not online. DragonscapeRevamped
Joined: 27 Apr 2013
Total Posts: 36
30 Apr 2013 06:30 PM
[ Free modelzz script incoming ]


name="Human"

robo=script.Parent:clone()

function Dead()
wait(10)
robot=robo:clone()
robot.Parent=script.Parent.Parent
robot:makeJoints()
script.Parent:remove()
end


script.Parent.Human.Died:connect(Dead)

I guessed it would work from that respawn script.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
30 Apr 2013 06:38 PM
Here:

x = 0
y = 0
z = 0

function Death()
for i,v in pairs(game.Players:GetPlayers()) do
if v.Character then
if (v.Character.Torso.Position-script.Parent.Head.Position)<=10 then--Distance
v.Character.Torso.CFrame = CFrame.new(x,y,z)--It would kill the player if you used 'position'
end
end
end


script.Parent.Human.Died:connect(Death)
Report Abuse
DragonscapeRevamped is not online. DragonscapeRevamped
Joined: 27 Apr 2013
Total Posts: 36
30 Apr 2013 06:39 PM
If it works then I love you. I'll respond in a bit.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
30 Apr 2013 06:43 PM
--WHOOPS FORGOT AN END

x = 0
y = 0
z = 0

function Death()
for i,v in pairs(game.Players:GetPlayers()) do
if v.Character then
if (v.Character.Torso.Position-script.Parent.Head.Position)<=10 then--Distance
v.Character.Torso.CFrame = CFrame.new(x,y,z)--It would kill the player if you used 'position'
end
end
end
end

script.Parent.Human.Died:connect(Death)
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