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
 

Teleport Player to Player

Previous Thread :: Next Thread 
OnlineOne is online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
11 Nov 2016 05:05 PM
local parent = script.Parent
local dominantPlayer = script

dominantPlayer = game.Players:FindFirstChild(dominantPlayer.Name)

local victimPlayer = parent

victimPlayer = game.Players:FindFirstChild(victimPlayer.Name)

while wait() do--supposed to teleport the victimPlayer to dominantPlayer + (1, 0, 1) position every wait().
local dominantPos = dominantPlayer.Character.Torso
local victimPos = victimPlayer.Character.Torso

victimPos.CFrame = CFrame.new(dominantPos.CFrame + CFrame.new(1, 0, 1))
end

--Script's name is the name of the 'dominantPlayer'. Please help!


--Online
Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
11 Nov 2016 05:10 PM
victimPos.CFrame = CFrame.new(dominantPos.CFrame + Vector3.new(1, 0, 1))
Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
11 Nov 2016 05:10 PM
http://wiki.roblox.com/index.php?title=CFrame#CFrame_.2B_Vector3
Report Abuse
OnlineOne is online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
11 Nov 2016 05:17 PM
Thanks for the help, but it still doesn't work.


--Online
Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
11 Nov 2016 05:18 PM
Errors? What is it doing?

You need to provide what is actually happening instead of just code
Report Abuse
OnlineOne is online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
11 Nov 2016 05:20 PM
No errors. And like I said, it's just doing... nothing.


--Online
Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
11 Nov 2016 05:23 PM
where is the script located?

Is it's ancestor workspace, or Players?
Report Abuse
OnlineOne is online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
11 Nov 2016 05:24 PM
It's located inside the victimPlayer.


--Online
Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
11 Nov 2016 05:25 PM
And is that the Player object, that is inside of 'game.Players' or is it the character that is inside of 'game.Workspace'?
Report Abuse
enzotinman1 is not online. enzotinman1
Joined: 22 Jun 2012
Total Posts: 408
11 Nov 2016 05:26 PM
did you look inside of the server window console for errors? I can't imagine there would be none.
Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
11 Nov 2016 05:26 PM
scripts do not run inside of game.Players
Report Abuse
OnlineOne is online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
11 Nov 2016 05:27 PM
It's the player, not the Character. The Explorer looks like this.

game
Players
Player1
Script
OtherStuff


--Online
Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
11 Nov 2016 05:28 PM
As I said, it doesn't work inside of players.

A player object is inside of players.
Report Abuse
OnlineOne is online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
11 Nov 2016 05:29 PM
Ah, that's the problem then. I'll put it in the PlayerScripts then. Thanks for the help!


--Online
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