#Building a plane using a tutorial video, need help for most of this.
6 messages · Page 1 of 1 (latest)
Discord: https://discord.gg/bEn49K5JUt
Patreon: https://www.patreon.com/Suphi
Donate: https://www.roblox.com/games/7532473490
0:00:00 - Intro
0:02:11 - Flight Physics
0:13:00 - Setup
0:13:50 - Network Owner
0:17:09 - Flight Script
0:26:34 - Motors
0:31:13 - Hinges
0:37:49 - Physics
1:05:46 - Outro
Song: Maze & Trinist - Everything Will Be Okay...
I'm currently stuck halfway through the flight script part of the video, where the code adds a beam to the planes.
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local connection = nil
local seat = nil
local function Start()
print("Start")
local model = seat:FindFirstAncestorOfClass("Model")
for index, decendant in model:GetDecendants() do
if decendant:IsA("BasePart") == true then
local attachment0 = Instance.new("Attachment", decendant)
local attachment1 = Instance.new("Attachment", decendant)
local beam = Instance.new("Beam")
beam.FaceCamera = true
beam.Segments = 1
beam.Width0 = 0.2
beam.Width1 = 0.2
beam.Color = ColorSequence.new(Color3.new(1, 0, 0))
beam.Attachment0 = attachment0
beam.Attachment1 = attachment1
beam.Parent = decendant
end
end
end
local function Stop()
print("Stop")
end
local function Loop(deltaTime)
end
local function Seated(active, currentSeat)
if active == false then
if connection == nil then return end
connection:Disconnect()
connection = nil
Stop()
seat = nil
elseif currentSeat.Name == "Plane" then
seat = currentSeat
Start()
connection = RunService.PostSimulation:Connect(Loop)
end
end
humanoid.Seated:Connect(Seated)```
This is my code I have in StarterCharacterScripts.
so the code works now. woo, but Im not sure if im supposed to have more stuff in it.