of     1   

MasterDaniel
#36165264Friday, October 29, 2010 10:36 AM GMT

I have this removal script, that checks if someones sat in the seat, if not it removes it, but if it does, and then the player exits, it removes after 30 secs. The last bit (marked below) works on its own with the function, but the bit at the top dosen't work. I am unsure whether this is a problem with the ends or with the script itself. Seat = script.Parent Time = 30 LastSit = 0 function Seated(Added) wait(Time) if not Added:IsA("Weld") then Seat.Parent:Remove() else -- The rest after this works on its own local ThisSit = time() LastSit = ThisSit while Added.Parent do Added.AncestryChanged:wait() end wait(Time) if LastSit == ThisSit then Seat.Parent:Remove() end end end end Seat.ChildAdded:connect(Seated) This output came up Workspace.Bus15.VehicleSeat.Script:22: 'eof' expected near 'end' Any help would be much appreciated, as this is VERY important in my game. MasterDaniel
AgentFirefox
Top 100 Poster
#36165504Friday, October 29, 2010 10:51 AM GMT

One end for each do, if, function lines. One until for each repeat line. You had function, if, and if; this means you need 3 ends. You put 5. Seat = script.Parent Time = 30 LastSit = 0 function Seated(Added) wait(Time) if not Added:IsA("Weld") then Seat.Parent:Remove() else -- The rest after this works on its own local ThisSit = time() LastSit = ThisSit while Added.Parent do Added.AncestryChanged:wait() end wait(Time) if LastSit == ThisSit then Seat.Parent:Remove() end end Seat.ChildAdded:connect(Seated)
MasterDaniel
#36166811Friday, October 29, 2010 12:12 PM GMT

I read somewhere, I think the wiki, that every dash on the side means it must be ended. Anyhow, this didn't remove it after 30 secs, I haven't tested whether it would still work when someone sits in it and gets out MasterDaniel
Prehistoricman
#36166848Friday, October 29, 2010 12:15 PM GMT

'that every dash on the side means it must be ended' Bogas is all I can say to that.
Prehistoricman
#36166866Friday, October 29, 2010 12:17 PM GMT

'if LastSit == ThisSit then' How could possibly they be the same after 30 seconds?
MasterDaniel
#36166935Friday, October 29, 2010 12:21 PM GMT

I am not entirely sure, my friend helped me with some of it, and never really explained lol. The rest I did. Anyhow, maybe thats whats wrong then?
MasterDaniel
#36169439Friday, October 29, 2010 2:34 PM GMT

bump
MasterDaniel
#36216729Saturday, October 30, 2010 9:59 AM GMT

bump
FlamedSkull
#36217198Saturday, October 30, 2010 10:34 AM GMT

By the way, I just got here and its not "Weld". Its actually "SeatWeld".
MasterDaniel
#36217591Saturday, October 30, 2010 11:07 AM GMT

I changed it to SeatWeld, and it never removed after 60 secs, and after sitting in and getting out, it still didn't remove after 60 sec :(
MasterDaniel
#36234037Saturday, October 30, 2010 5:25 PM GMT

bump

    of     1