shinx591
|
  |
| Joined: 23 Sep 2013 |
| Total Posts: 3 |
|
|
| 17 Mar 2017 03:42 PM |
So, what I wished to do was to make an object interact with a player that touches it. To do so, I created a variable for each player that would be on one server (player1 - player12).
However, the script stops working whenever it fails to find a player.
Is there anyway around this error, or do I have to completely redo the script to make it work? |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 17 Mar 2017 03:44 PM |
No reason to create variables for players or anything like that,
What do you mean by "interact" ?
|
|
|
| Report Abuse |
|
|
shinx591
|
  |
| Joined: 23 Sep 2013 |
| Total Posts: 3 |
|
|
| 17 Mar 2017 03:58 PM |
the object itself is supposed to teleport the nearest player.
It might be a problem with the function teleporting the player itself I'm not sure.
If needed I'll post the script. |
|
|
| Report Abuse |
|
|
shinx591
|
  |
| Joined: 23 Sep 2013 |
| Total Posts: 3 |
|
|
| 20 Mar 2017 08:01 PM |
| Does anyone have a solution? |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 21 Mar 2017 11:54 AM |
local destination = Vector3.new(0,0,0) -- define this
script.Parent.Touched:connect(function(hit) local char = hit.Parent local player = game.Players:GetPlayerFromCharacter(char) if player then char:MoveTo(detination) end end)
|
|
|
| Report Abuse |
|
|
|
| 21 Mar 2017 01:08 PM |
| if statements or protected calls |
|
|
| Report Abuse |
|
|