#Help on creating a vehicle building system

5 messages · Page 1 of 1 (latest)

small barn
#

Hello, I am oistehri and I want to create a vehicle building system for my vehicle building game, but I have no idea how do I do that or where do I start from. I have tried a simple script (I am not a professional programmer yet.)

local carpart = game.Workspace:WaitForChild("CarPart")
local carpartgoal = game.Workspace:WaitForChild("CarPartGoal")
local module = require(game:GetService("ReplicatedStorage"):FindFirstChild("GrabModule"))
local function placePart()
        if module.isGrabbing(true) then
            carpart:Destroy()
            carpartgoal.Transparency = 0
            carpartgoal.CanCollide = true
        end
    end
uis.InputBegan:Connect(function(input, gameProc)
            if input.KeyCode == Enum.KeyCode.E and not gameProc then
                carpartgoal.Touched:Connect(carpart, placePart)
                end
            end``` 

I've tried multiple scripts but none of them don't seem to work as intended.
My game's entire point is to build a car, take care of it and survive. The vehicle building system should be something similar to an experience called "a dusty trip. I am not trying to recreate a dusty trip, by the way. 
It should work like this: if user the bool value from the module and if player presses a specified key, the carpart is should be placed down. Also I want it to work with A-Chassis; when every part required is placed in the car, A-Chassis will be enabled.
Again, I'm not a professional scripter.
Thanks.
mossy socket
#

Why do you have ...:Connect(carpart, placePart)?

#

Why is carpart there is my question?

small barn
#

As I already said, I'm not very professional.

small barn
#

I would be very thankful if anyone helped.