|
| 17 Jun 2014 11:28 AM |
Getting this error:
09:25:59.129 - function onTouched(hit) local player = game.Players:Get:8: attempt to index global 'script' (a nil value)
With this script:
function onTouched(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:GetService("TeleportService"):Teleport(game.Workspace.TeleportDisplay.PlaceIdValue.Value, player) end end script.Parent.Touched:connect(onTouched)
And I'm not sure what it means. |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2014 11:30 AM |
| are you using a normal script under the brick? |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Jun 2014 11:32 AM |
function onTouched(hit) local player = hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:GetService("TeleportService"):Teleport(game.Workspace.TeleportDisplay.PlaceIdValue.Value, player) end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2014 11:34 AM |
Alright, going to test the script now.
Already ran it in Command Bar and no error.
But can you explain what fixed it? All I see is that you changed what the player variable is |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2014 11:46 AM |
I checked to see if there was a parent of hit since without it, it would error. If it still does not work then I am stumped. |
|
|
| Report Abuse |
|
|