generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Car Spawn not Working (for a friend)

Previous Thread :: Next Thread 
DailyTime is not online. DailyTime
Joined: 09 Nov 2013
Total Posts: 285
10 Jun 2014 04:40 PM
The output said:

end expected (to close 'function' at line 1) near eof


This is the script:

function clear()

local kid = script.Parent.Parent.Parent

local char = kid.Character:GetChildren()
for i = 1,#char do
if char[i].Name == "VS3" then
char[i]:Destroy()
end

local tools = kid.Backpack:GetChildren()
for i = 1,#tools do
if tools[i].Name == "Ranger" or tools[i].Name == "SS" or tools[i].Name == "Fourta" or tools[i].Name == "S5" then
tools[i]:Destroy()
end
end

local spawns = game.Workspace["Parking Spots"]:GetChildren()
for i = 1,#spawns do
if spawns[i].Name == "Car Spawns" then
local cars = spawns[i]["Car Holder"]:GetChildren()
for k = 1,#cars do
if cars[k]:FindFirstChild(kid.Name) then
cars[k]:Destroy()
end
end
end
end

end


function Select(Mouse)

Mouse.Button1Down:connect(function()
local kick = Mouse.Target
if kick ~= nil then
if kick.Name == "Car Spawn" then
clear()
local car = game.Lighting.Cars[script.Parent.Name]:clone()

local grab = kick.Parent["Car Holder"]:GetChildren()
for i = 1,#grab do
grab[i]:Destroy()
end

local tag = Instance.new("IntValue")
tag.Name = script.Parent.Parent.Parent.Name
tag.Parent = car

car:MakeJoints()
car.Parent = kick.Parent["Car Holder"]
car:MakeJoints()
car:MoveTo(kick.Position)
car:MakeJoints()

wait(1)

car.VS3.Parts.Script.Disabled = false
car.VS3.Parts.Speed.Disabled = false
car.VS3.Parts.Lights.Activated.Disabled = false
car.VS3.Parts.Lights.Director.Disabled = false
car.VS3.Parts.Doors.WeldScript.Disabled = false
car.VS3.Parts.Doors.WeldScript.Disabled = false
end
end
end)

end

script.Parent.Selected:connect(Select)
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
10 Jun 2014 04:45 PM
add this V
end
before this V
script.Parent.Selected:connect(Select)
Report Abuse
DailyTime is not online. DailyTime
Joined: 09 Nov 2013
Total Posts: 285
10 Jun 2014 04:50 PM
there already is an end there and it underlines it red when i do put it there.
Report Abuse
DailyTime is not online. DailyTime
Joined: 09 Nov 2013
Total Posts: 285
10 Jun 2014 05:00 PM
bump
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
10 Jun 2014 09:30 PM
Add another. Does it underline the connection line or the end? Because for me it underlines the connection line until you add another end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image