Xanth
|
  |
| Joined: 14 Oct 2007 |
| Total Posts: 7691 |
|
|
| 23 Jul 2016 10:45 AM |
This is a script within a PlayerGui, so you spawn with the script inside of your Player.
script.Parent.Parent.Parent.Character.Torso.CFrame = game.Workspace.RespawnRoom.CFrame + Vector3.new(0,5,0)
It works in studio testing mode but doesn't work in multiplayer. I'm wondering if this has to do with it needing to be a local script or not but I'm not sure. |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 23 Jul 2016 10:49 AM |
That's a .... bad way of doing it. Yes, use a LocalScript. Use this code:
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:wait()
character:WaitForChild("Torso").CFrame = workspace:WaitForChild("RespawnRoom", 7).CFrame + Vector3.new(0,5,0) |
|
|
| Report Abuse |
|
|
Xanth
|
  |
| Joined: 14 Oct 2007 |
| Total Posts: 7691 |
|
|
| 23 Jul 2016 10:51 AM |
| Oh I forgot to mention that I don't need to wait for things to load. This script is triggered by something else once the game has loaded so you really don't have to wait for anything to load still. |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 23 Jul 2016 10:53 AM |
| it should be a localscript and reference the localplayer's character either way |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Jul 2016 11:03 AM |
--local script
local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:wait() local torso = char.Torso
torso.CFrame = workspace.RespawnRoom.CFrame * CFrame.new(0,5,0)
However I suggest you do this on the server. there is not really point to move the character on the client...
|
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 23 Jul 2016 11:08 AM |
" * CFrame.new(0,5,0)"
What if it's upside down. |
|
|
| Report Abuse |
|
|