RoboX790
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 285 |
|
|
| 04 Sep 2013 10:07 AM |
So i want to change the CurrentCamere to a brick in the car and here is the script:
function onChildAdded(child) if child.Name == "SeatWeld" then if child.Part1.Name == "Torso" then player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) if player ~= nil then if player.Humanoid.Sit == true then player.CurrentCamera = script.Parent.Parent.CameraX end end end end end
function onChildRemoved() --camera fix function will be here end
script.Parent.ChildAdded:connect(onChildAdded) script.Parent.ChildRemoved:connect(onChildRemoved)
OUTPUT:
19:06:55.400 - Humanoid is not a valid member of Player 19:06:55.400 - Script 'Workspace.Model.VehicleSeat.Script', Line 6 19:06:55.401 - stack end 19:06:55.401 - Disconnected event because of exception |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2013 10:09 AM |
| player = game.Players[child.Part1.Parent] |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2013 10:11 AM |
ops no
first change camera type to scriptable then set camera object |
|
|
| Report Abuse |
|
|
RoboX790
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 285 |
|
|
| 04 Sep 2013 10:13 AM |
Nope it doesnt work but i updated the script not it gives another error:
function onChildAdded(child) if child.Name == "SeatWeld" then if child.Part1.Name == "Torso" then player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) if player ~= nil then if child.Part1.Parent.Humanoid.Sit == true then child.Part1.Parent.CurrentCamera = script.Parent.Parent.CameraX end end end end end
function onChildRemoved() --camera fix function will be here end
script.Parent.ChildAdded:connect(onChildAdded) script.Parent.ChildRemoved:connect(onChildRemoved)
Output:
19:12:49.789 - CurrentCamera is not a valid member of Model 19:12:49.790 - Script 'Workspace.Model.VehicleSeat.Script', Line 7 19:12:49.790 - stack end 19:12:49.790 - Disconnected event because of exception |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2013 10:15 AM |
| do what i tell you in second post |
|
|
| Report Abuse |
|
|
RoboX790
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 285 |
|
|
| 04 Sep 2013 10:19 AM |
| Doesnt work or i didnt get what u said post me the full script? |
|
|
| Report Abuse |
|
|