function BoatModule:moveBoat(boat, userInput) -- Calculate the force to apply based on user input local force = Vector3.new(userInput.Forward.X, 0, userInput.Forward.Z)
-- Move the player character player.Character.HumanoidRootPart.CFrame = player.Character.HumanoidRootPart.CFrame + direction * game:GetService("RunService").RenderStepped:wait() end build a boat for treasure script
function TreasureModule:generateTreasure() -- Select a random treasure model local treasureModels = {"TreasureChest", "TreasureBarrel", "TreasureStatue"} local treasureModel = treasureModels[math.random(1, #treasureModels)] build a boat for treasure script
-- Loop through components and add them to the boat for _, component in pairs(components) do local part = Instance.new("Part") part.Name = component.name part.Size = component.size part.Material = component.material part.Parent = boat build a boat for treasure script
return treasure end
local BoatModule = {}
-- BoatModule.lua