|
| 08 Aug 2014 07:14 PM |
local spawn = {Vector3.new(game.Workspace.Map.Spawn1.Position),Vector3.new(game.Workspace.Map.Spawn2.Position),Vector3.new(game.Workspace.Map.Spawn3.Position),Vector3.new(game.Workspace.Map.Spawn3.Position)} function onClick() script.Parent.Parent.Parent:destroy() game.Players.LocalPlayer.Character:MoveTo(math.random(#spawn)) end
script.Parent["MouseButton1Click"]:connect(onClick) |
|
|
| Report Abuse |
|
|
Vescatur
|
  |
| Joined: 18 Feb 2012 |
| Total Posts: 3426 |
|
| |
|
| |
|
Vescatur
|
  |
| Joined: 18 Feb 2012 |
| Total Posts: 3426 |
|
|
| 08 Aug 2014 07:18 PM |
Just for me, change the script to this, then tell me the output.
local spawn = {Vector3.new(game.Workspace.Map.Spawn1.Position),Vector3.new(game.Workspace.Map.Spawn2.Position),Vector3.new(game.Workspace.Map.Spawn3.Position),Vector3.new(game.Workspace.Map.Spawn3.Position)} function onClick() print("1") script.Parent.Parent.Parent:destroy() print("2") game.Players.LocalPlayer.Character:MoveTo(math.random(#spawn)) print("3") end
script.Parent["MouseButton1Click"]:connect(onClick)
If it prints 3, then it's a bit harder to fix. If it doesn't print 2 or 3, then it's an easy fix. |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2014 07:21 PM |
| I added a wait for child then I got, "19:20:45.694 - Unable to cast double to Vector3" |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Aug 2014 07:24 PM |
Try using this, game.Players.LocalPlayer.Character:MoveTo(spawn[math.random(#spawn)]) |
|
|
| Report Abuse |
|
|
Vescatur
|
  |
| Joined: 18 Feb 2012 |
| Total Posts: 3426 |
|
|
| 08 Aug 2014 07:24 PM |
Wouldn't the math.random(#spawn) only give you the number?
So, like wouldn't you need to do something like:
game.Players.LocalPlayer.Character:MoveTo(spawn[math.random(#spawn)]) |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2014 07:27 PM |
| It then just moves me like 10 studs over, and thats not where the spawn position is |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2014 07:29 PM |
| I made it print where it's teleporting me to, and its just going to 0,0,0 |
|
|
| Report Abuse |
|
|