function BoatModule:createBoat(player, components) -- Create a new boat model local boat = Instance.new("Model") boat.Name = player.Name .. "'s Boat"
-- BoatModule.lua
-- Position the treasure in the game world treasure.CFrame = CFrame.new(math.random(-100, 100), 10, math.random(-100, 100))
function PlayerModule:movePlayer(player, userInput) -- Calculate the movement direction based on user input local direction = Vector3.new(userInput.Forward.X, 0, userInput.Forward.Z)
-- 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