|
| 06 Dec 2013 05:22 PM |
I have a local script in a model in the players camera, but the script does not run. It has print statements but none of them print. There is no output from this script whatsoever.
local unit = script.Parent local destcon print("Unit Script Loaded")
destcon = unit.ListReferance.Value.Path.Destination.Changed:connect(function(v) status, error = pcall(move_to(v)) if not status then print(error) end end);
function move_to(destination) print(destination) pos = unit.Parent.Parent.World[destination].Position + Vector3.new(0, 3, 0) cs = CFrame.new(unit.Center.Position, pos) for i = 0, -(unit.Center.Position - pos).magnitude, -unit.ListReferance.Speed.Value/100 do unit.Center.CFrame = cs * CFrame.new(0, 0, -i) wait() end end
|
|
|
| Report Abuse |
|
|
|
| 06 Dec 2013 05:41 PM |
Will the Changed event of a Vector3Value trigger if the Value is changed? Also, pcall will ALWAYS fail because you have wait() in the moveto function. Change pcall to ypcall. |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 06 Dec 2013 06:21 PM |
| How did you test these? Sometimes LocalScript errors dont show up Play Solo mode, nor does it show up in the RemoteMoniteringScript. Use Start Server -> Start Player, and then look in the Player's output box. |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2013 07:14 PM |
| solo mode is only local scripts(Normal scripts are considered local i don't know if the _G is the same though, but localplayer and camera manipulation all work from a normal script). Any error from local script does show up in output in solo mode. |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2013 10:47 PM |
"solo mode is only local scripts(Normal scripts are considered local i don't know if the _G is the same though, but localplayer and camera manipulation all work from a normal script). Any error from local script does show up in output in solo mode."
It would make sense that the _G would be the same between LocalScripts and Scripts in Solo mode. The game is run on the local machine itself, so both the player and the server are running on the local machine (not just the player), meaning all scripts will run locally, regardless of class. |
|
|
| Report Abuse |
|
|