|
| 21 Jun 2014 07:45 PM |
Im trying to make it so that if something touches a brick then it gets the player from a vehicleseat and gives them player points. Output says weld is nil because there is no time for anybody to sit down yet. How else would I label weld?
db = false
function onTouch(points) if db or Workspace.VehicleSeat.SeatWeld == nil then return end player = game.Players:GetPlayerFromCharacter(Workspace.VehicleSeat.SeatWeld.Parent) db = true Game:GetService("PointsService"):AwardPoints(player.userId, 5) db = false end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2014 07:48 PM |
*edit*
It breaks when the brick is touched because SeatWeld "is not a valid member" instead of ending like it should |
|
|
| Report Abuse |
|
|
Stiiky
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 451 |
|
|
| 21 Jun 2014 08:20 PM |
| What you mean when the brick is touched? When a player touches it? Or like it touches the car? |
|
|
| Report Abuse |
|
|